Skip to content
This repository was archived by the owner on Jul 12, 2019. It is now read-only.

Commit 082b939

Browse files
committed
Better distribution of commited bundled files
1 parent b6d78ca commit 082b939

7 files changed

+29
-22
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ npm test
2121

2222
#### See it online:
2323

24-
https://sarimarton.github.io/tmdb-ui-cyclejs/
24+
https://sarimarton.github.io/tmdb-ui-cyclejs/dist/

bundle.js

-14
This file was deleted.

dist/bundle.js

+14
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

index.html dist/index.html

File renamed without changes.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"scripts": {
88
"test": "webpack --entry ./test/test.js --output test/test.compiled.js --display none && mocha test/test.compiled.js",
99
"start": "webpack-dev-server --mode=development --open 'Google Chrome'",
10-
"build": "webpack"
10+
"build": "webpack --mode=production"
1111
},
1212
"repository": {
1313
"type": "git",

src/index.html

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
<title><%= htmlWebpackPlugin.options.title %></title>
66

77
<!-- UIkit CSS -->
8-
<link rel="stylesheet" href="/node_modules/uikit/dist/css/uikit.min.css" />
8+
<link rel="stylesheet" href="node_modules/uikit/dist/css/uikit.min.css" />
99

1010
<!-- UIkit JS -->
11-
<script src="/node_modules/uikit/dist/js/uikit.min.js"></script>
12-
<script src="/node_modules/uikit/dist/js/uikit-icons.min.js"></script>
11+
<script src="node_modules/uikit/dist/js/uikit.min.js"></script>
12+
<script src="node_modules/uikit/dist/js/uikit-icons.min.js"></script>
1313
</head>
1414
<body>
1515
<div id="app"></div>

webpack.config.js

+10-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ const HtmlWebpackPlugin = require('html-webpack-plugin');
33
const CleanWebpackPlugin = require('clean-webpack-plugin');
44
const CopyWebpackPlugin = require('copy-webpack-plugin');
55

6-
module.exports = {
6+
const config = {
77
entry: {
88
app: ["./src/main.js"]
99
},
@@ -42,7 +42,14 @@ module.exports = {
4242
},
4343
output: {
4444
path: path.resolve(__dirname, 'dist'),
45-
publicPath: '/',
4645
filename: "bundle.js",
4746
}
48-
}
47+
};
48+
49+
module.exports = (env, argv) => {
50+
if (argv.mode === 'development') {
51+
config.output.publicPath = '/';
52+
}
53+
54+
return config;
55+
};

0 commit comments

Comments
 (0)