首页 > 代码库 > Webpack 学习记录-01

Webpack 学习记录-01

Webpack 2.0系列

1,output path路径必须为absolute path.

{
  entry: ‘./src/app.js‘,
  output: {
    filename: ‘bundle.js‘,
    path: __dirname + ‘/build‘
  }
}
 

output.path  The output directory as an absolute path (required).

若写为:  path:"./dist/js"   则报错如下:
Invalid configuration object. Webpack has been initialised using a configuration
 object that does not match the API schema.
 - configuration.context: The provided value "./dist/js" is not an absolute path!

Webpack 学习记录-01