Skip to content

Commit

Permalink
Improve settings for CopyWebpackPlugin
Browse files Browse the repository at this point in the history
  • Loading branch information
wtetsu committed Sep 9, 2019
1 parent 66bd9e3 commit 4d3e07d
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,15 @@ const jaRule = require("deinja/src/data");

const isProd = process.env.NODE_ENV === "production";

const copyWebpackPluginConfigs = [
{ from: "static", to: "." },
{ from: __dirname + "/node_modules/milligram/dist/milligram.min.css", to: "options/" }
];

if (!isProd) {
copyWebpackPluginConfigs.push({ from: "static_overwrite", to: "." });
}

module.exports = {
mode: process.env.NODE_ENV || "development",
entry: {
Expand Down Expand Up @@ -40,11 +49,7 @@ module.exports = {
extensions: [".js", ".jsx"]
},
plugins: [
new CopyWebpackPlugin([
{ from: "static", to: "." },
{ from: "static_overwrite", to: "." },
{ from: __dirname + "/node_modules/milligram/dist/milligram.min.css", to: "options/" }
]),
new CopyWebpackPlugin(copyWebpackPluginConfigs),
new UniteJsonPlugin([
{
from: [
Expand Down

0 comments on commit 4d3e07d

Please sign in to comment.