Skip to content
Snippets Groups Projects
Commit 6632f685 authored by esikkala's avatar esikkala
Browse files

Add copy-webpack-plugin

parent c9424a0d
No related branches found
No related tags found
No related merge requests found
source diff could not be displayed: it is too large. Options to address this: view the blob.
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
"client": "webpack-dev-server --config webpack.client.dev.js", "client": "webpack-dev-server --config webpack.client.dev.js",
"server": "nodemon src/server/index.js --exec babel-node ", "server": "nodemon src/server/index.js --exec babel-node ",
"build-client": "webpack --progress --config webpack.client.prod.js", "build-client": "webpack --progress --config webpack.client.prod.js",
"build-server": "babel --no-babelrc --presets=es2015 src/server --out-dir ./dist/server --copy-files", "build-server": "babel --no-babelrc --presets=es2015 src/server --out-dir ./dist/server",
"serve": "NODE_ENV=production node dist/server/index.js", "serve": "NODE_ENV=production node dist/server/index.js",
"test": "jest --watch" "test": "jest --watch"
}, },
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
"babel-preset-react": "^6.24.1", "babel-preset-react": "^6.24.1",
"clean-webpack-plugin": "^0.1.19", "clean-webpack-plugin": "^0.1.19",
"concurrently": "^3.6.1", "concurrently": "^3.6.1",
"copy-webpack-plugin": "^4.5.2",
"css-loader": "^0.28.11", "css-loader": "^0.28.11",
"enzyme": "^3.3.0", "enzyme": "^3.3.0",
"enzyme-adapter-react-16": "^1.1.1", "enzyme-adapter-react-16": "^1.1.1",
......
const path = require('path'); const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin'); const HtmlWebpackPlugin = require('html-webpack-plugin');
const CleanWebpackPlugin = require('clean-webpack-plugin'); const CleanWebpackPlugin = require('clean-webpack-plugin');
const CopyWebpackPlugin = require('copy-webpack-plugin');
const webpack = require('webpack'); const webpack = require('webpack');
const outputDirectory = 'dist/public'; const outputDirectory = 'dist/public';
...@@ -18,6 +19,9 @@ module.exports = { ...@@ -18,6 +19,9 @@ module.exports = {
}), }),
new webpack.NamedModulesPlugin(), new webpack.NamedModulesPlugin(),
new webpack.HotModuleReplacementPlugin(), new webpack.HotModuleReplacementPlugin(),
new CopyWebpackPlugin([
{from: 'src/client/img', to: 'img'}
])
], ],
output: { output: {
filename: '[name].bundle.js', filename: '[name].bundle.js',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment