在一些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) 截至今天上午,具有角CLI的1.0.0-beta.14
我ng new try3
和ng 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) 我安装了 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)