vigetlabs / blendid

A delicious blend of gulp tasks combined into a configurable asset pipeline and static site builder
MIT License
4.97k stars 680 forks source link

Uglify error: Unexpected token: punc (() during Production build #460

Closed dobromir-hristov closed 6 years ago

dobromir-hristov commented 7 years ago

Hello. I am getting this error when trying to build. I am using Vue with ES6 code, but I thought babel was transpiling to ES5.

OS: Windows 10 npm: 5.0.3 node: 6.9.1

Error:
app-6171f5bd733acda4b80c.js from UglifyJs
Unexpected token:
punc (() [app-6171f5bd733acda4b80c.js:372,6]

This is my task-config.js

module.exports = {
  html: true,
  images: true,
  fonts: true,
  static: true,
  svgSprite: false,
  ghPages: false,
  stylesheets: true,

  javascripts: {
    babel: {
      presets: [['es2015', {'modules': false}], 'stage-2']
    },
    entry: {
      // files paths are relative to
      // javascripts.dest in path-config.json
      app: ['./app.js']
    },
    alias: {
      'vue$': 'vue/dist/vue.esm.js'
    },
    loaders: [
      {
        test: /\.vue$/,
        loader: 'vue-loader'
      }
    ]
  },
  browserSync: {
    server: {
      // should match `dest` in
      // path-config.json
      baseDir: 'public'
    }
  },

  production: {
    rev: false
  }
}

I am also getting Error: EXDEV: cross-device link not permitted, rename but I can get the files from there, I dont really care.

dobromir-hristov commented 7 years ago

I managed to make it work by creating a .balelrc file with the exact same settings as the one in the config. The second error with coping the file from windows/Temp to my public folder still persists. But I just did a manual copy because I dont have the nerve to debug that one.

greypants commented 7 years ago

for the second error see notes in #415 - you can specify a different temp directory. Babelrc issue I need to look into...

dobromir-hristov commented 7 years ago

Ye, setting "temp": "./temp" in config fixes the second issue.

Demian87 commented 7 years ago

setting "temp": "./temp" in config fixes the second issue.

Where did you put it?

gregkohn commented 6 years ago

@Demian87 see here https://github.com/vigetlabs/blendid/issues/415#issuecomment-303145615