move copyplugin to webpack.common

This commit is contained in:
grafixeyehero 2019-10-01 02:58:05 +03:00
parent 716ac36031
commit 2572de460b
3 changed files with 41 additions and 36 deletions

View file

@ -1,23 +1,18 @@
const path = require('path');
const path = require("path");
const CopyPlugin = require("copy-webpack-plugin");
module.exports = {
context: path.resolve(__dirname, 'src'),
entry: './bundle.js',
context: path.resolve(__dirname, "src"),
entry: "./bundle.js",
resolve: {
modules: [
path.resolve(__dirname, 'node_modules')
]
},
module: {
rules: [
{
test: /\.css$/i,
use: ['style-loader', 'css-loader']
},
{
test: /\.(png|jpg|gif)$/i,
use: ['file-loader']
}
path.resolve(__dirname, "node_modules")
]
},
plugins: [
new CopyPlugin([{
from: "**/*",
to: "."
}])
]
};