@@ -75,17 +75,33 @@ const config = {
7575
7676 module : {
7777 rules : [
78+ {
79+ test : / c r e a t e - z i p \/ .* \/ f i l e s \/ .* \. i c o $ / ,
80+ loader : 'base64-loader' ,
81+ } ,
82+ {
83+ test : / c r e a t e - z i p \/ .* \/ f i l e s \/ .* $ / ,
84+ exclude : [ / c r e a t e - z i p \/ .* \/ f i l e s \/ .* \. i c o $ / ] ,
85+ loader : 'raw-loader' ,
86+ } ,
7887 {
7988 test : / \. j s $ / ,
8089 include : paths . src ,
81- exclude : [ / e s l i n t \. 4 \. 1 \. 0 \. m i n \. j s $ / , / t y p e s c r i p t S e r v i c e s \. j s $ / ] ,
90+ exclude : [
91+ / e s l i n t \. 4 \. 1 \. 0 \. m i n \. j s $ / ,
92+ / t y p e s c r i p t S e r v i c e s \. j s $ / ,
93+ // Don't do the node modules of the codesandbox module itself
94+ / c o d e s a n d b o x \/ n o d e _ m o d u l e s / ,
95+ / c r e a t e - z i p \/ .* \/ f i l e s \/ .* $ / ,
96+ ] ,
8297 loader : 'happypack/loader' ,
8398 } ,
8499 // JSON is not enabled by default in Webpack but both Node and Browserify
85100 // allow it implicitly so we also enable it.
86101 {
87102 test : / \. j s o n $ / ,
88103 loader : 'json-loader' ,
104+ exclude : [ / c r e a t e - z i p \/ .* \/ f i l e s \/ .* $ / ] ,
89105 } ,
90106 // "postcss" loader applies autoprefixer to our CSS.
91107 // "css" loader resolves paths in CSS and adds assets as dependencies.
@@ -95,18 +111,20 @@ const config = {
95111 {
96112 test : / \. c s s $ / ,
97113 loaders : [ 'style-loader' , 'css-loader' ] ,
114+ exclude : [ / c r e a t e - z i p \/ .* \/ f i l e s \/ .* $ / ] ,
98115 } ,
99116 // For importing README.md
100117 {
101118 test : / \. m d $ / ,
102119 loader : 'raw-loader' ,
120+ exclude : [ / c r e a t e - z i p \/ .* \/ f i l e s \/ .* $ / ] ,
103121 } ,
104122 // "file" loader makes sure those assets get served by WebpackDevServer.
105123 // When you `import` an asset, you get its (virtual) filename.
106124 // In production, they would get copied to the `build` folder.
107125 {
108126 test : / \. ( i c o | j p g | p n g | g i f | e o t | o t f | w e b p | s v g | t t f | w o f f | w o f f 2 ) ( \? .* ) ? $ / ,
109- exclude : / \/ f a v i c o n .i c o $ / ,
127+ exclude : [ / \/ f a v i c o n .i c o $ / , / c r e a t e - z i p \/ . * \/ f i l e s \/ . * $ / ] ,
110128 loader : 'file-loader' ,
111129 options : {
112130 name : 'static/media/[name].[hash:8].[ext]' ,
@@ -116,6 +134,7 @@ const config = {
116134 {
117135 test : / \/ f a v i c o n .i c o $ / ,
118136 include : [ paths . src ] ,
137+ exclude : [ / c r e a t e - z i p \/ .* \/ f i l e s \/ .* $ / ] ,
119138 loader : 'file-loader' ,
120139 options : {
121140 name : 'favicon.ico?[hash:8]' ,
@@ -126,6 +145,7 @@ const config = {
126145 {
127146 test : / \. ( m p 4 | w e b m ) ( \? .* ) ? $ / ,
128147 loader : 'url-loader' ,
148+ exclude : [ / c r e a t e - z i p \/ .* \/ f i l e s \/ .* $ / ] ,
129149 options : {
130150 limit : 10000 ,
131151 name : 'static/media/[name].[hash:8].[ext]' ,
@@ -136,6 +156,7 @@ const config = {
136156 {
137157 test : / \. h t m l $ / ,
138158 loader : 'html-loader' ,
159+ exclude : [ / c r e a t e - z i p \/ .* \/ f i l e s \/ .* $ / ] ,
139160 options : {
140161 attrs : [ 'link:href' ] ,
141162 } ,
@@ -241,6 +262,10 @@ const config = {
241262 : 'node_modules/monaco-editor/min/vs' ,
242263 to : 'public/vs' ,
243264 } ,
265+ {
266+ from : 'static' ,
267+ to : 'static' ,
268+ } ,
244269 {
245270 from : 'src/homepage/static' ,
246271 to : 'static' ,
@@ -460,6 +485,15 @@ if (__PROD__) {
460485 } ,
461486 } ,
462487 } ,
488+ {
489+ urlPattern : / c l o u d f l a r e \. c o m / ,
490+ handler : 'cacheFirst' ,
491+ options : {
492+ cache : {
493+ name : 'cloudflare-cache' ,
494+ } ,
495+ } ,
496+ } ,
463497 ] ,
464498 } ) ,
465499 // Moment.js is an extremely popular library that bundles large locale files
0 commit comments