小编lov*_*ice的帖子

使用Webpack 2和extract-text-webpack-plugin

我正在使用带有Webpack 2.2.1的extract-text-webpack-plugin 2.0.0-rc.3,并且在运行构建时出现此错误:

/node_modules/extract-text-webpack-plugin/index.js:259
var shouldExtract = !!(options.allChunks || chunk.isInitial());
                                                  ^
TypeError: chunk.isInitial is not a function
Run Code Online (Sandbox Code Playgroud)

这是我的webpack.config.js:

'use strict';
const argv = require('yargs').argv;
const ExtractTextPlugin = require("extract-text-webpack-plugin");
const webpack = require('webpack');

module.exports = (function () {
  let config = {
    entry   : './' + process.env.npm_package_config_paths_source + '/main.js',
    output  : {
      filename : 'main.js'
    },
    watch   : !!argv.watch,
    vue     : {
      loaders : {
        js   : 'babel-loader',
        // Create separate CSS file to prevent unstyled content
        sass : ExtractTextPlugin.extract("css!sass?sourceMap") // …
Run Code Online (Sandbox Code Playgroud)

javascript webpack vue.js webpack-2

5
推荐指数
1
解决办法
1469
查看次数

标签 统计

javascript ×1

vue.js ×1

webpack ×1

webpack-2 ×1