Skip to content

Commit

Permalink
Merge pull request #50 from DivadNojnarg/webpack-config-css-rule
Browse files Browse the repository at this point in the history
allow import "path/style.css" inside jsx (update webpack.config.js bo…
  • Loading branch information
timelyportfolio authored Feb 16, 2021
2 parents da3e6af + 5ca81b1 commit c6f7806
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
4 changes: 3 additions & 1 deletion inst/templates/package.json.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
"@babel/core": "^7.2.0",
"babel-loader": "^8.0.4",
"@babel/preset-env": "^7.2.0",
"@babel/preset-react": "^7.0.0"
"@babel/preset-react": "^7.0.0",
"css-loader": "^5.0.1",
"style-loader": "^2.0.0"
}
}
5 changes: 5 additions & 0 deletions inst/templates/webpack.config.js.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ module.exports = {
options: {
presets: ['@babel/preset-env', '@babel/preset-react']
}
},
// For CSS so that import "path/style.css"; works
{
test: /\.css$/,
use: ['style-loader', 'css-loader']
}
]
},
Expand Down

0 comments on commit c6f7806

Please sign in to comment.