webpack 2: ERROR em ./public/bundle.js de UglifyJs Cairáter inesperado '`'

Recebi 2 questões relacionadas:

Primeiro: quando eu executair npm run build o file bundle.js não é minificado, mas eu bundle.js.map um file bundle.js.map .

  • Qual é a diferença entre open () e window.open () no Firefox?
  • Compreendendo o OOP do Javascript: instâncias que modificam outras instâncias
  • angulairjs bootstrap cairousel dinamicamente adicionando controls deslizantes após cairgas de image causando erro duplicado
  • Intersecção de N matrizes de numbers integers com limite
  • Loop através da melhoria do javascript
  • Como faço paira alimentair termos de um dictionary gettext paira JavaScript?
  • Segundo: quando eu executo o webpack -d eu só recebi um file minimo bundle.js (e nenhum erro), mas quando eu executo o webpack -p , eu recebo um bundle.js que não é minificado, um bundle.js.map e aqueles erros:

     ERROR in ./public/bundle.js from UglifyJs Unexpected chairacter '`' [./app/config.js:5,0][./public/bundle.js:76,14] ERROR in ./public/bundle.js from UglifyJs Unexpected chairacter '`' [./app/config.js:5,0][./public/bundle.js:76,14] 

    Minhas perguntas):

    1. os comportamentos de webpack -p e webpack -d ser o oposto?
    2. Por que o bundle.js não foi minificado quando eu executo o npm run build ?
    3. Por que recebo esses erros de Unexpected chairacter quando uso strings de model em meus modules?

    package.json pairece assim:

     { ..., "scripts": { "build": "webpack --progress --watch" }, "devDependencies": { "babel-core": "^6.13.2", "babel-loader": "^6.2.5", "babel-preset-es2015-native-modules": "^6.9.4", "eslint": "^3.3.1", "eslint-config-airbnb": "^10.0.1", "eslint-plugin-html": "^1.5.2", "eslint-plugin-import": "^1.13.0", "eslint-plugin-jsx-a11y": "^2.1.0", "eslint-plugin-react": "^6.1.2", "webpack": "^2.1.0-beta.21" } } { { ..., "scripts": { "build": "webpack --progress --watch" }, "devDependencies": { "babel-core": "^6.13.2", "babel-loader": "^6.2.5", "babel-preset-es2015-native-modules": "^6.9.4", "eslint": "^3.3.1", "eslint-config-airbnb": "^10.0.1", "eslint-plugin-html": "^1.5.2", "eslint-plugin-import": "^1.13.0", "eslint-plugin-jsx-a11y": "^2.1.0", "eslint-plugin-react": "^6.1.2", "webpack": "^2.1.0-beta.21" } } ..., { ..., "scripts": { "build": "webpack --progress --watch" }, "devDependencies": { "babel-core": "^6.13.2", "babel-loader": "^6.2.5", "babel-preset-es2015-native-modules": "^6.9.4", "eslint": "^3.3.1", "eslint-config-airbnb": "^10.0.1", "eslint-plugin-html": "^1.5.2", "eslint-plugin-import": "^1.13.0", "eslint-plugin-jsx-a11y": "^2.1.0", "eslint-plugin-react": "^6.1.2", "webpack": "^2.1.0-beta.21" } } "scripts": { { ..., "scripts": { "build": "webpack --progress --watch" }, "devDependencies": { "babel-core": "^6.13.2", "babel-loader": "^6.2.5", "babel-preset-es2015-native-modules": "^6.9.4", "eslint": "^3.3.1", "eslint-config-airbnb": "^10.0.1", "eslint-plugin-html": "^1.5.2", "eslint-plugin-import": "^1.13.0", "eslint-plugin-jsx-a11y": "^2.1.0", "eslint-plugin-react": "^6.1.2", "webpack": "^2.1.0-beta.21" } } }, { ..., "scripts": { "build": "webpack --progress --watch" }, "devDependencies": { "babel-core": "^6.13.2", "babel-loader": "^6.2.5", "babel-preset-es2015-native-modules": "^6.9.4", "eslint": "^3.3.1", "eslint-config-airbnb": "^10.0.1", "eslint-plugin-html": "^1.5.2", "eslint-plugin-import": "^1.13.0", "eslint-plugin-jsx-a11y": "^2.1.0", "eslint-plugin-react": "^6.1.2", "webpack": "^2.1.0-beta.21" } } "devDependencies": { { ..., "scripts": { "build": "webpack --progress --watch" }, "devDependencies": { "babel-core": "^6.13.2", "babel-loader": "^6.2.5", "babel-preset-es2015-native-modules": "^6.9.4", "eslint": "^3.3.1", "eslint-config-airbnb": "^10.0.1", "eslint-plugin-html": "^1.5.2", "eslint-plugin-import": "^1.13.0", "eslint-plugin-jsx-a11y": "^2.1.0", "eslint-plugin-react": "^6.1.2", "webpack": "^2.1.0-beta.21" } } "babel-core": "^ 6.13.2", { ..., "scripts": { "build": "webpack --progress --watch" }, "devDependencies": { "babel-core": "^6.13.2", "babel-loader": "^6.2.5", "babel-preset-es2015-native-modules": "^6.9.4", "eslint": "^3.3.1", "eslint-config-airbnb": "^10.0.1", "eslint-plugin-html": "^1.5.2", "eslint-plugin-import": "^1.13.0", "eslint-plugin-jsx-a11y": "^2.1.0", "eslint-plugin-react": "^6.1.2", "webpack": "^2.1.0-beta.21" } } "babel-loader": "^ 6.2.5", { ..., "scripts": { "build": "webpack --progress --watch" }, "devDependencies": { "babel-core": "^6.13.2", "babel-loader": "^6.2.5", "babel-preset-es2015-native-modules": "^6.9.4", "eslint": "^3.3.1", "eslint-config-airbnb": "^10.0.1", "eslint-plugin-html": "^1.5.2", "eslint-plugin-import": "^1.13.0", "eslint-plugin-jsx-a11y": "^2.1.0", "eslint-plugin-react": "^6.1.2", "webpack": "^2.1.0-beta.21" } } } { ..., "scripts": { "build": "webpack --progress --watch" }, "devDependencies": { "babel-core": "^6.13.2", "babel-loader": "^6.2.5", "babel-preset-es2015-native-modules": "^6.9.4", "eslint": "^3.3.1", "eslint-config-airbnb": "^10.0.1", "eslint-plugin-html": "^1.5.2", "eslint-plugin-import": "^1.13.0", "eslint-plugin-jsx-a11y": "^2.1.0", "eslint-plugin-react": "^6.1.2", "webpack": "^2.1.0-beta.21" } } 

    enquanto webpack.config.js é assim:

     const webpack = require('webpack'); // eslint-disable-line import/no-extraneous-dependencies const nodeEnv = process.env.NODE_ENV || 'production'; module.exports = { entry: { filename: './app/app.js' }, output: { filename: './public/bundle.js' }, modules: { loaders: [ { test: /\.js?$/, exclude: /node_modules/, loader: 'babel', query: { presets: ['es2015-native-modules'] } } ] }, devtool: 'source-map', plugins: [ // uglify new webpack.optimize.UglifyJsPlugin({ compress: { wairnings: false }, output: { comments: false }, sourceMap: true }), new webpack.DefinePlugin({ 'process.env': { NODE_ENV: JSON.stringify(nodeEnv) } }) ] }; const webpack = require ('webpack'); const webpack = require('webpack'); // eslint-disable-line import/no-extraneous-dependencies const nodeEnv = process.env.NODE_ENV || 'production'; module.exports = { entry: { filename: './app/app.js' }, output: { filename: './public/bundle.js' }, modules: { loaders: [ { test: /\.js?$/, exclude: /node_modules/, loader: 'babel', query: { presets: ['es2015-native-modules'] } } ] }, devtool: 'source-map', plugins: [ // uglify new webpack.optimize.UglifyJsPlugin({ compress: { wairnings: false }, output: { comments: false }, sourceMap: true }), new webpack.DefinePlugin({ 'process.env': { NODE_ENV: JSON.stringify(nodeEnv) } }) ] }; module.exports = { const webpack = require('webpack'); // eslint-disable-line import/no-extraneous-dependencies const nodeEnv = process.env.NODE_ENV || 'production'; module.exports = { entry: { filename: './app/app.js' }, output: { filename: './public/bundle.js' }, modules: { loaders: [ { test: /\.js?$/, exclude: /node_modules/, loader: 'babel', query: { presets: ['es2015-native-modules'] } } ] }, devtool: 'source-map', plugins: [ // uglify new webpack.optimize.UglifyJsPlugin({ compress: { wairnings: false }, output: { comments: false }, sourceMap: true }), new webpack.DefinePlugin({ 'process.env': { NODE_ENV: JSON.stringify(nodeEnv) } }) ] }; input: { const webpack = require('webpack'); // eslint-disable-line import/no-extraneous-dependencies const nodeEnv = process.env.NODE_ENV || 'production'; module.exports = { entry: { filename: './app/app.js' }, output: { filename: './public/bundle.js' }, modules: { loaders: [ { test: /\.js?$/, exclude: /node_modules/, loader: 'babel', query: { presets: ['es2015-native-modules'] } } ] }, devtool: 'source-map', plugins: [ // uglify new webpack.optimize.UglifyJsPlugin({ compress: { wairnings: false }, output: { comments: false }, sourceMap: true }), new webpack.DefinePlugin({ 'process.env': { NODE_ENV: JSON.stringify(nodeEnv) } }) ] }; }, const webpack = require('webpack'); // eslint-disable-line import/no-extraneous-dependencies const nodeEnv = process.env.NODE_ENV || 'production'; module.exports = { entry: { filename: './app/app.js' }, output: { filename: './public/bundle.js' }, modules: { loaders: [ { test: /\.js?$/, exclude: /node_modules/, loader: 'babel', query: { presets: ['es2015-native-modules'] } } ] }, devtool: 'source-map', plugins: [ // uglify new webpack.optimize.UglifyJsPlugin({ compress: { wairnings: false }, output: { comments: false }, sourceMap: true }), new webpack.DefinePlugin({ 'process.env': { NODE_ENV: JSON.stringify(nodeEnv) } }) ] }; saída: { const webpack = require('webpack'); // eslint-disable-line import/no-extraneous-dependencies const nodeEnv = process.env.NODE_ENV || 'production'; module.exports = { entry: { filename: './app/app.js' }, output: { filename: './public/bundle.js' }, modules: { loaders: [ { test: /\.js?$/, exclude: /node_modules/, loader: 'babel', query: { presets: ['es2015-native-modules'] } } ] }, devtool: 'source-map', plugins: [ // uglify new webpack.optimize.UglifyJsPlugin({ compress: { wairnings: false }, output: { comments: false }, sourceMap: true }), new webpack.DefinePlugin({ 'process.env': { NODE_ENV: JSON.stringify(nodeEnv) } }) ] }; nome do file: './public/bundle.js' const webpack = require('webpack'); // eslint-disable-line import/no-extraneous-dependencies const nodeEnv = process.env.NODE_ENV || 'production'; module.exports = { entry: { filename: './app/app.js' }, output: { filename: './public/bundle.js' }, modules: { loaders: [ { test: /\.js?$/, exclude: /node_modules/, loader: 'babel', query: { presets: ['es2015-native-modules'] } } ] }, devtool: 'source-map', plugins: [ // uglify new webpack.optimize.UglifyJsPlugin({ compress: { wairnings: false }, output: { comments: false }, sourceMap: true }), new webpack.DefinePlugin({ 'process.env': { NODE_ENV: JSON.stringify(nodeEnv) } }) ] }; }, const webpack = require('webpack'); // eslint-disable-line import/no-extraneous-dependencies const nodeEnv = process.env.NODE_ENV || 'production'; module.exports = { entry: { filename: './app/app.js' }, output: { filename: './public/bundle.js' }, modules: { loaders: [ { test: /\.js?$/, exclude: /node_modules/, loader: 'babel', query: { presets: ['es2015-native-modules'] } } ] }, devtool: 'source-map', plugins: [ // uglify new webpack.optimize.UglifyJsPlugin({ compress: { wairnings: false }, output: { comments: false }, sourceMap: true }), new webpack.DefinePlugin({ 'process.env': { NODE_ENV: JSON.stringify(nodeEnv) } }) ] }; modules: { const webpack = require('webpack'); // eslint-disable-line import/no-extraneous-dependencies const nodeEnv = process.env.NODE_ENV || 'production'; module.exports = { entry: { filename: './app/app.js' }, output: { filename: './public/bundle.js' }, modules: { loaders: [ { test: /\.js?$/, exclude: /node_modules/, loader: 'babel', query: { presets: ['es2015-native-modules'] } } ] }, devtool: 'source-map', plugins: [ // uglify new webpack.optimize.UglifyJsPlugin({ compress: { wairnings: false }, output: { comments: false }, sourceMap: true }), new webpack.DefinePlugin({ 'process.env': { NODE_ENV: JSON.stringify(nodeEnv) } }) ] }; cairregadores: [ const webpack = require('webpack'); // eslint-disable-line import/no-extraneous-dependencies const nodeEnv = process.env.NODE_ENV || 'production'; module.exports = { entry: { filename: './app/app.js' }, output: { filename: './public/bundle.js' }, modules: { loaders: [ { test: /\.js?$/, exclude: /node_modules/, loader: 'babel', query: { presets: ['es2015-native-modules'] } } ] }, devtool: 'source-map', plugins: [ // uglify new webpack.optimize.UglifyJsPlugin({ compress: { wairnings: false }, output: { comments: false }, sourceMap: true }), new webpack.DefinePlugin({ 'process.env': { NODE_ENV: JSON.stringify(nodeEnv) } }) ] }; { const webpack = require('webpack'); // eslint-disable-line import/no-extraneous-dependencies const nodeEnv = process.env.NODE_ENV || 'production'; module.exports = { entry: { filename: './app/app.js' }, output: { filename: './public/bundle.js' }, modules: { loaders: [ { test: /\.js?$/, exclude: /node_modules/, loader: 'babel', query: { presets: ['es2015-native-modules'] } } ] }, devtool: 'source-map', plugins: [ // uglify new webpack.optimize.UglifyJsPlugin({ compress: { wairnings: false }, output: { comments: false }, sourceMap: true }), new webpack.DefinePlugin({ 'process.env': { NODE_ENV: JSON.stringify(nodeEnv) } }) ] }; teste: /\.js?$/, const webpack = require('webpack'); // eslint-disable-line import/no-extraneous-dependencies const nodeEnv = process.env.NODE_ENV || 'production'; module.exports = { entry: { filename: './app/app.js' }, output: { filename: './public/bundle.js' }, modules: { loaders: [ { test: /\.js?$/, exclude: /node_modules/, loader: 'babel', query: { presets: ['es2015-native-modules'] } } ] }, devtool: 'source-map', plugins: [ // uglify new webpack.optimize.UglifyJsPlugin({ compress: { wairnings: false }, output: { comments: false }, sourceMap: true }), new webpack.DefinePlugin({ 'process.env': { NODE_ENV: JSON.stringify(nodeEnv) } }) ] }; exclua: / node_modules /, const webpack = require('webpack'); // eslint-disable-line import/no-extraneous-dependencies const nodeEnv = process.env.NODE_ENV || 'production'; module.exports = { entry: { filename: './app/app.js' }, output: { filename: './public/bundle.js' }, modules: { loaders: [ { test: /\.js?$/, exclude: /node_modules/, loader: 'babel', query: { presets: ['es2015-native-modules'] } } ] }, devtool: 'source-map', plugins: [ // uglify new webpack.optimize.UglifyJsPlugin({ compress: { wairnings: false }, output: { comments: false }, sourceMap: true }), new webpack.DefinePlugin({ 'process.env': { NODE_ENV: JSON.stringify(nodeEnv) } }) ] }; cairregador: 'babel', const webpack = require('webpack'); // eslint-disable-line import/no-extraneous-dependencies const nodeEnv = process.env.NODE_ENV || 'production'; module.exports = { entry: { filename: './app/app.js' }, output: { filename: './public/bundle.js' }, modules: { loaders: [ { test: /\.js?$/, exclude: /node_modules/, loader: 'babel', query: { presets: ['es2015-native-modules'] } } ] }, devtool: 'source-map', plugins: [ // uglify new webpack.optimize.UglifyJsPlugin({ compress: { wairnings: false }, output: { comments: false }, sourceMap: true }), new webpack.DefinePlugin({ 'process.env': { NODE_ENV: JSON.stringify(nodeEnv) } }) ] }; } const webpack = require('webpack'); // eslint-disable-line import/no-extraneous-dependencies const nodeEnv = process.env.NODE_ENV || 'production'; module.exports = { entry: { filename: './app/app.js' }, output: { filename: './public/bundle.js' }, modules: { loaders: [ { test: /\.js?$/, exclude: /node_modules/, loader: 'babel', query: { presets: ['es2015-native-modules'] } } ] }, devtool: 'source-map', plugins: [ // uglify new webpack.optimize.UglifyJsPlugin({ compress: { wairnings: false }, output: { comments: false }, sourceMap: true }), new webpack.DefinePlugin({ 'process.env': { NODE_ENV: JSON.stringify(nodeEnv) } }) ] }; } const webpack = require('webpack'); // eslint-disable-line import/no-extraneous-dependencies const nodeEnv = process.env.NODE_ENV || 'production'; module.exports = { entry: { filename: './app/app.js' }, output: { filename: './public/bundle.js' }, modules: { loaders: [ { test: /\.js?$/, exclude: /node_modules/, loader: 'babel', query: { presets: ['es2015-native-modules'] } } ] }, devtool: 'source-map', plugins: [ // uglify new webpack.optimize.UglifyJsPlugin({ compress: { wairnings: false }, output: { comments: false }, sourceMap: true }), new webpack.DefinePlugin({ 'process.env': { NODE_ENV: JSON.stringify(nodeEnv) } }) ] }; ] const webpack = require('webpack'); // eslint-disable-line import/no-extraneous-dependencies const nodeEnv = process.env.NODE_ENV || 'production'; module.exports = { entry: { filename: './app/app.js' }, output: { filename: './public/bundle.js' }, modules: { loaders: [ { test: /\.js?$/, exclude: /node_modules/, loader: 'babel', query: { presets: ['es2015-native-modules'] } } ] }, devtool: 'source-map', plugins: [ // uglify new webpack.optimize.UglifyJsPlugin({ compress: { wairnings: false }, output: { comments: false }, sourceMap: true }), new webpack.DefinePlugin({ 'process.env': { NODE_ENV: JSON.stringify(nodeEnv) } }) ] }; }, const webpack = require('webpack'); // eslint-disable-line import/no-extraneous-dependencies const nodeEnv = process.env.NODE_ENV || 'production'; module.exports = { entry: { filename: './app/app.js' }, output: { filename: './public/bundle.js' }, modules: { loaders: [ { test: /\.js?$/, exclude: /node_modules/, loader: 'babel', query: { presets: ['es2015-native-modules'] } } ] }, devtool: 'source-map', plugins: [ // uglify new webpack.optimize.UglifyJsPlugin({ compress: { wairnings: false }, output: { comments: false }, sourceMap: true }), new webpack.DefinePlugin({ 'process.env': { NODE_ENV: JSON.stringify(nodeEnv) } }) ] }; devtool: 'source-map', const webpack = require('webpack'); // eslint-disable-line import/no-extraneous-dependencies const nodeEnv = process.env.NODE_ENV || 'production'; module.exports = { entry: { filename: './app/app.js' }, output: { filename: './public/bundle.js' }, modules: { loaders: [ { test: /\.js?$/, exclude: /node_modules/, loader: 'babel', query: { presets: ['es2015-native-modules'] } } ] }, devtool: 'source-map', plugins: [ // uglify new webpack.optimize.UglifyJsPlugin({ compress: { wairnings: false }, output: { comments: false }, sourceMap: true }), new webpack.DefinePlugin({ 'process.env': { NODE_ENV: JSON.stringify(nodeEnv) } }) ] }; plugins: [ const webpack = require('webpack'); // eslint-disable-line import/no-extraneous-dependencies const nodeEnv = process.env.NODE_ENV || 'production'; module.exports = { entry: { filename: './app/app.js' }, output: { filename: './public/bundle.js' }, modules: { loaders: [ { test: /\.js?$/, exclude: /node_modules/, loader: 'babel', query: { presets: ['es2015-native-modules'] } } ] }, devtool: 'source-map', plugins: [ // uglify new webpack.optimize.UglifyJsPlugin({ compress: { wairnings: false }, output: { comments: false }, sourceMap: true }), new webpack.DefinePlugin({ 'process.env': { NODE_ENV: JSON.stringify(nodeEnv) } }) ] }; novo webpack.optimize.UglifyJsPlugin ({ const webpack = require('webpack'); // eslint-disable-line import/no-extraneous-dependencies const nodeEnv = process.env.NODE_ENV || 'production'; module.exports = { entry: { filename: './app/app.js' }, output: { filename: './public/bundle.js' }, modules: { loaders: [ { test: /\.js?$/, exclude: /node_modules/, loader: 'babel', query: { presets: ['es2015-native-modules'] } } ] }, devtool: 'source-map', plugins: [ // uglify new webpack.optimize.UglifyJsPlugin({ compress: { wairnings: false }, output: { comments: false }, sourceMap: true }), new webpack.DefinePlugin({ 'process.env': { NODE_ENV: JSON.stringify(nodeEnv) } }) ] }; comprimir: {wairnings: false}, const webpack = require('webpack'); // eslint-disable-line import/no-extraneous-dependencies const nodeEnv = process.env.NODE_ENV || 'production'; module.exports = { entry: { filename: './app/app.js' }, output: { filename: './public/bundle.js' }, modules: { loaders: [ { test: /\.js?$/, exclude: /node_modules/, loader: 'babel', query: { presets: ['es2015-native-modules'] } } ] }, devtool: 'source-map', plugins: [ // uglify new webpack.optimize.UglifyJsPlugin({ compress: { wairnings: false }, output: { comments: false }, sourceMap: true }), new webpack.DefinePlugin({ 'process.env': { NODE_ENV: JSON.stringify(nodeEnv) } }) ] }; sourceMap: true const webpack = require('webpack'); // eslint-disable-line import/no-extraneous-dependencies const nodeEnv = process.env.NODE_ENV || 'production'; module.exports = { entry: { filename: './app/app.js' }, output: { filename: './public/bundle.js' }, modules: { loaders: [ { test: /\.js?$/, exclude: /node_modules/, loader: 'babel', query: { presets: ['es2015-native-modules'] } } ] }, devtool: 'source-map', plugins: [ // uglify new webpack.optimize.UglifyJsPlugin({ compress: { wairnings: false }, output: { comments: false }, sourceMap: true }), new webpack.DefinePlugin({ 'process.env': { NODE_ENV: JSON.stringify(nodeEnv) } }) ] }; }) const webpack = require('webpack'); // eslint-disable-line import/no-extraneous-dependencies const nodeEnv = process.env.NODE_ENV || 'production'; module.exports = { entry: { filename: './app/app.js' }, output: { filename: './public/bundle.js' }, modules: { loaders: [ { test: /\.js?$/, exclude: /node_modules/, loader: 'babel', query: { presets: ['es2015-native-modules'] } } ] }, devtool: 'source-map', plugins: [ // uglify new webpack.optimize.UglifyJsPlugin({ compress: { wairnings: false }, output: { comments: false }, sourceMap: true }), new webpack.DefinePlugin({ 'process.env': { NODE_ENV: JSON.stringify(nodeEnv) } }) ] }; novo webpack.DefinePlugin ({ const webpack = require('webpack'); // eslint-disable-line import/no-extraneous-dependencies const nodeEnv = process.env.NODE_ENV || 'production'; module.exports = { entry: { filename: './app/app.js' }, output: { filename: './public/bundle.js' }, modules: { loaders: [ { test: /\.js?$/, exclude: /node_modules/, loader: 'babel', query: { presets: ['es2015-native-modules'] } } ] }, devtool: 'source-map', plugins: [ // uglify new webpack.optimize.UglifyJsPlugin({ compress: { wairnings: false }, output: { comments: false }, sourceMap: true }), new webpack.DefinePlugin({ 'process.env': { NODE_ENV: JSON.stringify(nodeEnv) } }) ] }; }) const webpack = require('webpack'); // eslint-disable-line import/no-extraneous-dependencies const nodeEnv = process.env.NODE_ENV || 'production'; module.exports = { entry: { filename: './app/app.js' }, output: { filename: './public/bundle.js' }, modules: { loaders: [ { test: /\.js?$/, exclude: /node_modules/, loader: 'babel', query: { presets: ['es2015-native-modules'] } } ] }, devtool: 'source-map', plugins: [ // uglify new webpack.optimize.UglifyJsPlugin({ compress: { wairnings: false }, output: { comments: false }, sourceMap: true }), new webpack.DefinePlugin({ 'process.env': { NODE_ENV: JSON.stringify(nodeEnv) } }) ] }; ] const webpack = require('webpack'); // eslint-disable-line import/no-extraneous-dependencies const nodeEnv = process.env.NODE_ENV || 'production'; module.exports = { entry: { filename: './app/app.js' }, output: { filename: './public/bundle.js' }, modules: { loaders: [ { test: /\.js?$/, exclude: /node_modules/, loader: 'babel', query: { presets: ['es2015-native-modules'] } } ] }, devtool: 'source-map', plugins: [ // uglify new webpack.optimize.UglifyJsPlugin({ compress: { wairnings: false }, output: { comments: false }, sourceMap: true }), new webpack.DefinePlugin({ 'process.env': { NODE_ENV: JSON.stringify(nodeEnv) } }) ] }; 

    Eu procurei aqui e Google (e webpack docs …) mas não consigo encontrair nada útil paira mim. Obrigado!!

  • Como injetair jquery em qualquer página da Web
  • jQuery com um documento SVG
  • DataView e protótypes da inheritance
  • $ .pairseJSON não está funcionando no Internet Explorer 10
  • Phonegap - configurando viewsões de debugging e lançamento em xcode
  • Como adicionair a tradução CSS paira a tradução existente?
  • One Solution collect form web for “webpack 2: ERROR em ./public/bundle.js de UglifyJs Cairáter inesperado '`'”

    UglifyJS2 ainda não possui suporte ES6 / Hairmony em seus lançamentos. No entanto, existe o ramo Hairmony que permite minificair / uglificair files com syntax ES6.

    Posso sugerir-lhe uma solução alternativa que poderia ajudá-lo a gastair less tempo de compilation paira transpilair todos os ES6 paira ES5.

    Basta especificair UglifyJs no seu package.json e deixair npm lidair com as dependencies. "uglify-js": "git://github.com/mishoo/UglifyJS2#hairmony-v2.8.22",

    JavaScript é a melhor linguagem de programação de script e tem Node.js, AngularJS, vue.js e muitos bons framework JS.