update webpack config rules

This commit is contained in:
Colin Megill
2018-08-13 17:07:00 -07:00
committed by bkmartinjr
parent c57d648f15
commit 985cc0de94
2 changed files with 27 additions and 5 deletions
@@ -21,9 +21,12 @@ module.exports = {
filename: "static/js/bundle.js", filename: "static/js/bundle.js",
publicPath: "/" publicPath: "/"
}, },
resolve: { extensions: [".js", ".json"] }, resolve: {
extensions: [".js", ".json"],
modules: ["node_modules"]
},
module: { module: {
loaders: [ rules: [
{ {
test: /\.js$/, test: /\.js$/,
include: src, include: src,
@@ -33,8 +36,27 @@ module.exports = {
{ {
test: /\.css$/, test: /\.css$/,
include: [src, nodeModules], include: [src, nodeModules],
loader: loader: [
"style-loader!css-loader?modules&importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]!postcss-loader" {
loader: "style-loader"
},
{
loader: "css-loader",
options: {
modules: true,
importLoaders: 1,
localIdentName: "[name]__[local]___[hash:base64:5]"
}
},
{
loader: "postcss-loader",
options: {
plugins: function() {
return [];
}
}
}
]
}, },
{ test: /\.json$/, include: [src, nodeModules], loader: "json-loader" }, { test: /\.json$/, include: [src, nodeModules], loader: "json-loader" },
{ {
@@ -26,7 +26,7 @@ module.exports = {
}, },
resolve: { extensions: [".js", ".json"] }, resolve: { extensions: [".js", ".json"] },
module: { module: {
loaders: [ rules: [
{ {
test: /\.js$/, test: /\.js$/,
include: src, include: src,