私はこのReact/webpackプロジェクトでは、どのようにしてsassを使用できますか?
import sass from '../scss/application.scss';
Is this the wrong type of import above?
今のは私に次のエラーを与えて...
ERROR in ./app/components/Landing.js Module not found: Error: Can't resolve 'style' in '/Users/sam/Desktop/talkingwith/talkingwith' BREAKING CHANGE: It's no longer allowed to omit the '-loader' suffix when using loaders. You need to specify 'style-loader' instead of 'style'. @ ./app/components/Landing.js 13:19-54 @ ./app/App.js @ multi (webpack)-dev-server/client? http://localhost:3333 ./app/App.js
ない私は今、私のコンポーネントでSASSを使用する方法を確認して、それをインポートして、前に働いていました。
編集:私のWebPACKファイル
var HtmlWebpackPlugin = require('html-webpack-plugin');
var path = require('path');
var HTMLWebpackPluginConfig = new HtmlWebpackPlugin({
template: __dirname + '/app/index.html',
filename: 'index.html',
inject: 'body'
});
module.exports = {
entry: [
'./app/App.js'
],
output: {
path: __dirname + '/public',
filename: "bundle.js"
},
plugins: [HTMLWebpackPluginConfig],
devServer: {
inline:true,
contentBase: './public',
port: 3333
},
module: {
loaders: [{
test: /\.js$/,
exclude: /node_modules/,
loader: "babel-loader"
},
{
test: /\.scss$/,
loader: 'style!css!sass'
}]
}
};
あなたのスタイルの寿命を指定する必要があります。 webpack設定ファイルの違いは何ですか? – Pineda
は、ビュー – user3622460
のwebpackファイルを追加しました。 'loader: 'style-loader!css-loader!sass-loader!' ' – oobgam