Webpack: npm run build => error from UglifyJs Unexpected character '`' from UglifyJs Unexpected token: punc (()

Created on 11 Sep 2017  路  6Comments  路  Source: vuejs-templates/webpack

Hello ,

I 've got a problem that i can't fiind a solution .

i've got this conf :
webpack.base.conf.js:

{
        test: /\.(js|vue)$/,
        loader: 'eslint-loader',
        enforce: 'pre',
        include: [resolve('src'), resolve('test')],
        options: {
          formatter: require('eslint-friendly-formatter')
        }
      },
      {
        test: /\.vue$/,
        loader: 'vue-loader',
        options: vueLoaderConfig
      },
      {
        test: /\.js$/,
        loader: 'babel-loader',
        include: [resolve('src'), resolve('test')]
      },

in my package.json

"devDependencies": {
    "autoprefixer": "^6.7.2",
    "babel-core": "^6.22.1",
    "babel-eslint": "^7.1.1",
    "babel-loader": "^6.2.10",
    "babel-plugin-transform-runtime": "^6.22.0",
    "babel-preset-env": "^1.3.2",
    "babel-preset-stage-2": "^6.22.0",
    "babel-register": "^6.22.0",
    "chalk": "^1.1.3",

I tried solutions like this https://stackoverflow.com/questions/41519344/webpack-build-xxx-vue-error-when-use-uglifyjs but it didn't work
Moreover, I use vue webpack template, i don't need to use .babelsrc file

Thanks for your help

Most helpful comment

I come cross the same problem,how did you solve this problem?

All 6 comments

Are you using template literals in your code?

I don't get the point why you don't need babelrc file, vue-loader itself also uses this file.

in my code i have classical template in my .vue:
Inside my div template there is my html
below i have my script

I said that because in some solutions it suggests to add a file .babelrc with a typical conf to overwrite the other

The vue webpack template comes with a babelrc file and it is required for the template to work properly.

If you removed it, you broke your setup.

I did'nt remove any file

I did an update and now it's work

thank you !

In fact , the version of vue webpack when i get it is not the same than now

I come cross the same problem,how did you solve this problem?

Was this page helpful?
0 / 5 - 0 ratings