Closed niradler closed 6 years ago
https://babeljs.io/repl/ convert main.js with babel fix it
Cannot understand what you really mean?
Why would you process your node_modules via babel? There are already transpiled
step to reproduce create-react-app.cmd validator-test npm i indicative --save add import Validator from 'indicative' to App.js yarn build
There are already transpiled /node_modules/indicative/builds/main.js:1:4062 this file isnt, there is let in this line
Tried with this webpack config and it works fine.
const path = require('path');
const UglifyJsPlugin = require('uglifyjs-webpack-plugin')
module.exports = {
entry: path.join(__dirname, './app.js'),
output: {
path: path.resolve(__dirname),
filename: 'app.bundle.js'
},
module: {
rules: [
{
test: /\.js$/,
exclude: /(node_modules|bower_components)/,
use: {
loader: 'babel-loader',
options: {
presets: ['babel-preset-env']
}
}
}
]
},
plugins: [
new UglifyJsPlugin()
]
}
Also make sure the react app uses https://www.npmjs.com/package/uglify-es
@niradler Have u tried it?
I'm skiing in the moment, so only next week
@thetutlage what exactly do you need me to check ? in order to change the react config file i need to eject and i prefer not to do that.
In that case in don’t think I can do much, since all works fine with a simple webpack + UglifyJs plugin, so if create react app does something different, then u need to tell me that
Closing since not actionable
Failed to minify the code from this file:
Read more here: http://bit.ly/2tRViJ9
while running react build