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]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
└── [email protected]
,536,913,632 10
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 –