webpackでsass-loaderを使用しようとしていますが、この手順に従います - >https://github.com/webpack-contrib/extract-text-webpack-plugin#extracting-sass-or-lessしかしこれは動作しません。Webpack 3:sass-loaderを使用し、ExtractTextPluginが動作しない
誰でも助けてくれますか?
リポジトリ
https://github.com/gpincheiraa/boolean-html-js-exercises/tree/dev
エラー
ERROR in Error: Child compilation failed:
Module build failed: Error: "extract-text-webpack-plugin" loader is used without the corresponding plugin, refer to https://github.com/webpack/extract-text-webpack-plugin for the usage example
- Error: "extract-text-webpack-plugin" loader is used without the corresponding plugin, refer to https://github.com/webpack/extract-text-webpack-plugin for the usage example
依存
node v6.11.1
npm 5.3.0
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── html-webp[email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
└── [email protected]
webpack.config.js
const HtmlWebpackPlugin = require('html-webpack-plugin');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
module.exports = {
entry: [
"./index.js"
],
output: {
path: __dirname + "/dist",
filename: "index.bundle.js"
},
module: {
rules: [
{ test: /\.js$/, exclude: /node_modules/, loader: "babel-loader" },
{ test: /\.md$/, loaders: [ "html-loader", "markdown-loader" ] },
{ test: /\.scss$/,
use: ExtractTextPlugin.extract({
fallback: 'style-loader',
use: ['css-loader', 'sass-loader']
})
}
]
},
plugins: [
new ExtractTextPlugin('style.css'),
new HtmlWebpackPlugin({
template: 'index.html',
inject: 'body'
})
],
devtool: "eval-source-map",
devServer: {
filename: "index.bundle.js",
contentBase: "./",
port: 3000,
publicPath: "/",
stats: {
colors: true
}
}
};
あなたは私の人生を救った。私からの概念的な誤りでした。私はこのドキュメントを読んでいる:https://github.com/jantimon/html-webpack-plugin/blob/master/docs/template-option.mdそして最後に私は完全に理解している。 素晴らしい返信ありがとうございます! –
変更点:https://github.com/gpincheiraa/boolean-html-js-exercises/commit/2290ff64079d9e6ced40d2cf1f82d2f612ca8745 –