私はsassのためにwebpackを使用しようとしました(外側のファイルへのコンパイル。いくつかのjsファイルへの直接のincludind sassではありません)。 それは何とかしないので、出力からbundle.jsを受信します。それだけですが、外側のstyle.cssを持っています。webpackは外側のファイルにsassをコンパイルしません
私は何が間違っているのか分かりません。誰かが私を助けてくれますか?
私はいくつかの相対的なトピックをチェックしましたが、有用なアドバイスは見つかりませんでした。ここで
は@import "hamma";
html {
color: red;
&.blue {
color: black;
}
}
hamma.scss
html {
color: purple !important;
}
ファイル構造は非常に単純です
var ExtractTextPlugin = require('extract-text-webpack-plugin');
module.exports = {
entry: "./entry.js",
output: {
path: __dirname,
filename: "bundle.js"
},
module: {
loaders: [
{
test: /\.scss$/,
loader: ExtractTextPlugin.extract('style', 'raw!sass')
}
]
},
plugins: [
new ExtractTextPlugin('style.css', {
allChunks: true
})
]
};
zeta.scss私のWebPACK confにある
entry.js
zeta.scss
hamma.scss
webpack.config.
package.json
私のpackage.json
{
"name": "dsfsdfdsfds",
"version": "1.0.0",
"main": "entry.js",
"scripts": {
"test": "sdf"
},
"author": "",
"license": "ISC",
"description": "",
"devDependencies": {
"css-loader": "^0.26.0",
"extract-text-webpack-plugin": "^1.0.1",
"node-sass": "^3.13.0",
"sass-loader": "^4.0.2",
"style-loader": "^0.13.1",
"webpack": "^1.13.3"
}
}