@@ -93,34 +93,16 @@ module.exports = (env, argv) => ({
9393 exclude : / n o d e _ m o d u l e s / ,
9494 loader : 'babel-loader' ,
9595 options : {
96- // We have the babel config here rather than a file to help
97- // make it clearer what we're compiling to.
9896 cacheDirectory : true ,
99- sourceMaps : true ,
100- presets : [
101- [ "@babel/preset-env" , {
102- "targets" : {
103- "browsers" : [
104- "last 2 versions" ,
105- ]
106- } ,
107- } ] ,
108- "@babel/preset-typescript" ,
109- "@babel/preset-flow" ,
110- "@babel/preset-react" ,
111- ] ,
112- plugins : [
113- // Most of these plugins are for the react-sdk to make itself
114- // work correctly.
115- [ "@babel/plugin-proposal-decorators" , { "legacy" : true } ] ,
116- "@babel/plugin-proposal-export-default-from" ,
117- "@babel/plugin-proposal-numeric-separator" ,
118- "@babel/plugin-proposal-class-properties" ,
119- "@babel/plugin-proposal-object-rest-spread" ,
120- "@babel/plugin-transform-flow-comments" ,
121- "@babel/plugin-syntax-dynamic-import" ,
122- "@babel/plugin-transform-runtime"
123- ] ,
97+
98+ // These two options are needed to load the babelrc file and
99+ // apply it to node_modules (ie: react-sdk and js-sdk). We
100+ // could put the babel config in this block instead, but we
101+ // publish riot-web to npm for some reason and that seems to
102+ // ship a lib directory. Therefore, we need the babel config
103+ // in a place where babel and babel-loader can reach it.
104+ babelrc : true ,
105+ configFile : path . resolve ( __dirname , ".babelrc" ) ,
124106 }
125107 } ,
126108 {
0 commit comments