내 응용 프로그램에 그로 메트 스탠드 얼론을 설치하려고합니다.그로멧을 webpack 2와 함께 사용하려면
방금 webpack 구성에서 사용자 지정 속성을 배웠으므로 더 이상 지원되지 않습니다. 그래서 sassLoader
가 작동하지 않습니다. 나는 대체품 인 webpack.LoaderOptionsPlugin
을 사용할 수없는 것 같습니다.
이 질문에 대한 solution은 나에게 적합하지 않았습니다.
내 webpack.config.js
살펴 보자 여기
/* eslint no-var: 0 */
var path = require('path');
var webpack = require('webpack');
var WriteFilePlugin = require('write-file-webpack-plugin');
var HtmlWebpackPlugin = require('html-webpack-plugin');
var APP_DIR = path.resolve(__dirname, 'app');
module.exports = {
entry: [
'webpack-dev-server/client?http://localhost:8081',
'webpack/hot/only-dev-server',
path.join(APP_DIR, 'index.jsx')
],
output: {
path: path.join(__dirname, 'build'),
filename: 'bundle.js'
},
devServer: {
contentBase: './build',
hot: true,
inline: true,
historyApiFallback: true
},
plugins: [
new HtmlWebpackPlugin({
template: path.join(APP_DIR, 'index.tmp.html')
}),
new webpack.HotModuleReplacementPlugin(),
new webpack.LoaderOptionsPlugin({
debug: true,
options: {
sassLoader: {
includePaths: [
'./node_modules',
// this is required only for NPM < 3.
// Dependencies are flat in NPM 3+ so pointing to
// the internal grommet/node_modules folder is not needed
'./node_modules/grommet/node_modules'
]
}
}
}),
new WriteFilePlugin()
],
module: {
loaders: [
{
test: /\.jsx?$/,
exclude: /node_modules|bower_components/,
loader: 'babel-loader'
},
{
test: /\.scss$/,
loader: 'style-loader!css-loader!sass-loader?outputStyle=compressed'
}
]
}
};
내가 점점 오전 오류입니다 :
ERROR in ./~/css-loader!./~/sass-loader/lib/loader.js?outputStyle=compressed!./~/grommet/scss/vanilla/index.scss
Module build failed:
undefined
^
File to import not found or unreadable: inuit-defaults/settings.defaults.
Parent style sheet: C:/Users/TeneceUBA2/workspaces/sts/eagleswings/src/main/resources/public/node_modules/grommet/scss/grommet-core/_settings.scss
in C:\Users\TeneceUBA2\workspaces\sts\eagleswings\src\main\resources\public\node_modules\grommet\scss\grommet-core\_settings.scss (line 4, column 1)
@ ./~/grommet/scss/vanilla/index.scss 4:14-130 13:2-17:4 14:20-136
@ ./app/index.jsx
@ multi (webpack)-dev-server/client?http://localhost:8081 webpack/hot/dev-server webpack-dev-server/client?http://localhost:8081 webpack/hot/only-dev-server ./app/index.jsx
그리고 완전성에 대해
가 여기 내package.json
{
"name": "eagles",
"version": "1.0.0",
"description": "desc",
"main": "index.js",
"scripts": {
"dev": "webpack --config webpack.config.js",
"serve": "webpack-dev-server",
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "Tobe",
"license": "ISC",
"devDependencies": {
"babel-core": "^6.22.1",
"babel-loader": "^6.2.10",
"babel-plugin-react-transform": "^2.0.2",
"babel-preset-es2015": "^6.22.0",
"babel-preset-react": "^6.22.0",
"css-loader": "^0.26.1",
"eslint": "^3.15.0",
"eslint-config-airbnb": "^14.1.0",
"eslint-plugin-import": "^2.2.0",
"eslint-plugin-jsx-a11y": "^4.0.0",
"eslint-plugin-react": "^6.9.0",
"html-webpack-plugin": "^2.28.0",
"node-sass": "^4.5.0",
"react-transform-hmr": "^1.0.4",
"sass-loader": "^5.0.1",
"style-loader": "^0.13.1",
"webpack": "^2.2.1",
"webpack-dev-server": "^2.3.0",
"write-file-webpack-plugin": "^3.4.2"
},
"dependencies": {
"grommet": "^1.2.1",
"inuit-defaults": "^0.2.3",
"react": "^15.4.2",
"react-dom": "^15.4.2"
}
}
사람을 가지고 그로 멧이 webpack2와 함께 작동합니까? Google은 이번 행사에 도움이되지 않았습니다.