Skip to content

Commit c6f7806

Browse files
Merge pull request #50 from DivadNojnarg/webpack-config-css-rule
allow import "path/style.css" inside jsx (update webpack.config.js bo…
2 parents da3e6af + 5ca81b1 commit c6f7806

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

inst/templates/package.json.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
"@babel/core": "^7.2.0",
1010
"babel-loader": "^8.0.4",
1111
"@babel/preset-env": "^7.2.0",
12-
"@babel/preset-react": "^7.0.0"
12+
"@babel/preset-react": "^7.0.0",
13+
"css-loader": "^5.0.1",
14+
"style-loader": "^2.0.0"
1315
}
1416
}

inst/templates/webpack.config.js.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ module.exports = {
1616
options: {
1717
presets: ['@babel/preset-env', '@babel/preset-react']
1818
}
19+
},
20+
// For CSS so that import "path/style.css"; works
21+
{
22+
test: /\.css$/,
23+
use: ['style-loader', 'css-loader']
1924
}
2025
]
2126
},

0 commit comments

Comments
 (0)