I just updated webpack to 4.1.1
and when I try to run it I get the following error:
Invalid configuration object. Webpack has been initialise
Looked at an example loader for webpack 4.1.1:
https://webpack.js.org/loaders/raw-loader/
All I had to do was rename loaders
to rules
.
module: {
rules: [
{ test: /\.tsx?$/, loader: ['ts-loader'] },
{ test: /\.css$/, loader: "style-loader!css-loader" },
{
test: /\.scss$/, use: [{
loader: "style-loader" // creates style nodes from JS strings
}, {
loader: "css-loader" // translates CSS into CommonJS
}, {
loader: "sass-loader" // compiles Sass to CSS
}]
},
{ test: /\.(otf|ttf|eot|svg|woff(2)?)(\?[a-z0-9=&.]+)?$/, loader: 'file-loader?name=./Scripts/dist/[name].[ext]' }
]
}