相关疑难解决方法(0)

Webpack中的规则与加载器 - 有什么区别?

在一些Webpack示例中,您会看到对"rules"数组的引用:

module.exports = {
  module: {
    rules: [
      {
        test: /\.scss$/,
        use: ExtractTextPlugin.extract({
          fallback: 'style-loader',
          //resolve-url-loader may be chained before sass-loader if necessary
          use: ['css-loader', 'sass-loader']
        })
      }
    ]
  },
  plugins: [
    new ExtractTextPlugin('style.css')
    //if you want to pass in options, you can do so:
    //new ExtractTextPlugin({
    //  filename: 'style.css'
    //})
  ]
}
Run Code Online (Sandbox Code Playgroud)

(https://github.com/webpack-contrib/extract-text-webpack-plugin)

而在另一个,加载器数组:

var ExtractTextPlugin = require("extract-text-webpack-plugin");
module.exports = {
    module: {
        loaders: [
            {
                test: /\.css$/,
                loader: ExtractTextPlugin.extract({
                    loader: "css-loader"
                })
            },
            { test: /\.png$/, …
Run Code Online (Sandbox Code Playgroud)

webpack

68
推荐指数
1
解决办法
2万
查看次数

配置对象无效.Webpack已使用配置进行初始化

截至今天上午,具有角CLI的1.0.0-beta.14ng new try3ng serve并得到以下错误:

Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema.
 - configuration has an unknown property 'tslint'. These properties are valid:
   object { amd?, bail?, cache?, context?, devServer?, devtool?, entry, externals?, loader?, module?, name?, dependencies?, node?, output?, plugins?, profile?, recordsInputPath?, recordsOutputPath?, recordsPath?, resolve?, resolveLoader?, stats?, target?, watch?, watchOptions? }
 - configuration.module has an unknown property 'preLoaders'. These properties are valid:
   object { …
Run Code Online (Sandbox Code Playgroud)

angular2-cli angular

28
推荐指数
2
解决办法
3万
查看次数

webpack-dev-server 返回“配置具有未知属性‘错误’”

我安装了 webpack^3.0.0 和 webpack-dev-server^2.9.1 (在项目上和全局上)。在项目根目录中运行时webpack-dev-server,出现错误

Invalid configuration object. webpack-dev-server has been initialised 
using a configuration object that does not match the API schema.
 - configuration has an unknown property 'error'. These properties are 
valid:
object { hot?, hotOnly?, lazy?, bonjour?, host?, allowedHosts?, 
filename?, publicPath?, port?, socket?, watchOptions?, headers?, 
clientLogLevel?, overlay?, progress?, key?, cert?, ca?, pfx?, 
pfxPassphrase?, requestCert?, inline?, disableHostCheck?, public?, 
https?, contentBase?, watchContentBase?, open?, useLocalIp?, openPage?, 
features?, compress?, proxy?, historyApiFallback?, staticOptions?, 
setup?, before?, after?, stats?, reporter?, noInfo?, quiet?, …
Run Code Online (Sandbox Code Playgroud)

webpack webpack-dev-server

3
推荐指数
1
解决办法
2万
查看次数