@@ -17,6 +17,7 @@ const CssBlocksPlugin = require("@css-blocks/webpack").CssBlocksPlugin;
17
17
18
18
const jsxCompilationOptions = {
19
19
compilationOptions : { } ,
20
+ types : "typescript" ,
20
21
optimization : {
21
22
rewriteIdents : true ,
22
23
mergeDeclarations : true ,
@@ -57,10 +58,9 @@ const cssFilename = 'static/css/[name].[contenthash:8].css';
57
58
// (See https://github.com/webpack-contrib/extract-text-webpack-plugin/issues/27)
58
59
// However, our output is structured with css, js and media folders.
59
60
// To have this structure working with relative paths, we have to use custom options.
60
- const extractTextPluginOptions = shouldUseRelativeAssetPaths
61
- ? // Making sure that the publicPath goes back to to build folder.
62
- { publicPath : Array ( cssFilename . split ( '/' ) . length ) . join ( '../' ) }
63
- : { } ;
61
+ const extractTextPluginOptions = shouldUseRelativeAssetPaths ? // Making sure that the publicPath goes back to to build folder.
62
+ { publicPath : Array ( cssFilename . split ( '/' ) . length ) . join ( '../' ) } :
63
+ { } ;
64
64
65
65
// This is the production configuration.
66
66
// It compiles slowly and is focused on producing a fast and minimal bundle.
@@ -86,8 +86,8 @@ module.exports = {
86
86
// Point sourcemap entries to original disk location (format as URL on Windows)
87
87
devtoolModuleFilenameTemplate : info =>
88
88
path
89
- . relative ( paths . appSrc , info . absoluteResourcePath )
90
- . replace ( / \\ / g, '/' ) ,
89
+ . relative ( paths . appSrc , info . absoluteResourcePath )
90
+ . replace ( / \\ / g, '/' ) ,
91
91
} ,
92
92
resolve : {
93
93
// This allows you to set a fallback for where Webpack should look for modules.
@@ -106,7 +106,7 @@ module.exports = {
106
106
// for React Native Web.
107
107
extensions : [ '.web.js' , '.mjs' , '.js' , '.json' , '.web.jsx' , '.jsx' , '.tsx' , '.ts' ] ,
108
108
alias : {
109
-
109
+
110
110
// Support React Native Web
111
111
// https://www.smashingmagazine.com/2016/08/a-glimpse-into-the-future-with-react-native-for-web/
112
112
'react-native' : 'react-native-web' ,
@@ -132,16 +132,14 @@ module.exports = {
132
132
{
133
133
test : / \. ( j s | j s x | m j s ) $ / ,
134
134
enforce : 'pre' ,
135
- use : [
136
- {
137
- options : {
138
- formatter : eslintFormatter ,
139
- eslintPath : require . resolve ( 'eslint' ) ,
140
-
141
- } ,
142
- loader : require . resolve ( 'eslint-loader' ) ,
135
+ use : [ {
136
+ options : {
137
+ formatter : eslintFormatter ,
138
+ eslintPath : require . resolve ( 'eslint' ) ,
139
+
143
140
} ,
144
- ] ,
141
+ loader : require . resolve ( 'eslint-loader' ) ,
142
+ } , ] ,
145
143
include : paths . appSrc ,
146
144
} ,
147
145
@@ -236,7 +234,13 @@ module.exports = {
236
234
cacheDirectory : false ,
237
235
compact : true ,
238
236
parserOpts : {
239
- plugins : [ "jsx" ]
237
+ plugins : [
238
+ "jsx" ,
239
+ "doExpressions" ,
240
+ "objectRestSpread" ,
241
+ "decorators" ,
242
+ "classProperties" ,
243
+ ]
240
244
}
241
245
} ,
242
246
} ,
@@ -291,7 +295,7 @@ module.exports = {
291
295
optimization : jsxCompilationOptions . optimization
292
296
} ) ,
293
297
294
- cssAssets ( { minify : true , inlineSourceMaps : false } ) ,
298
+ cssAssets ( { minify : true , inlineSourceMaps : false } ) ,
295
299
296
300
// Makes some environment variables available in index.html.
297
301
// The public URL is available as %PUBLIC_URL% in index.html, e.g.:
@@ -398,4 +402,4 @@ module.exports = {
398
402
tls : 'empty' ,
399
403
child_process : 'empty' ,
400
404
} ,
401
- } ;
405
+ } ;
0 commit comments