Skip to content

Commit 2591d09

Browse files
committed
webpack copies images too :)
1 parent 4289817 commit 2591d09

File tree

3 files changed

+131
-65
lines changed

3 files changed

+131
-65
lines changed

package-lock.json

Lines changed: 120 additions & 61 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
"@babel/preset-env": "^7.28.5",
4545
"babel-loader": "^10.0.0",
4646
"bootstrap-icons": "^1.13.1",
47+
"copy-webpack-plugin": "^13.0.1",
4748
"css-loader": "^7.1.2",
4849
"eslint-config-google": "^0.14.0",
4950
"expose-loader": "^5.0.1",

webpack.config.js

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
var webpack = require('webpack');
2-
var path = require('path');
1+
const webpack = require('webpack');
2+
const CopyPlugin = require('copy-webpack-plugin')
3+
const path = require('path');
34
const sass = require('sass');
45

5-
var jsSrc = path.resolve('./frontend/javascript');
6+
var jsSrc = path.resolve('./frontend');
67
var jsDest = path.resolve('./conditional/static');
78
var publicPath = 'static/js';
89

@@ -13,7 +14,7 @@ var babelQuery = {
1314

1415
var webpackConfig = {
1516
context: jsSrc,
16-
entry: ["./app.js"],
17+
entry: ["./javascript/app.js"],
1718
output: {
1819
path: path.normalize(jsDest),
1920
filename: 'js/app.js',
@@ -26,6 +27,11 @@ var webpackConfig = {
2627
'NODE_ENV': JSON.stringify('production')
2728
}
2829
}),
30+
new CopyPlugin({
31+
patterns: [
32+
{ from: "images", to: "images" },
33+
],
34+
})
2935
],
3036
mode: 'production',
3137
module: {

0 commit comments

Comments
 (0)