Skip to content

Commit 9bc2e5b

Browse files
committed
chore: Fix webpack dev server
1 parent b2159c9 commit 9bc2e5b

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

.gitpod.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
tasks:
2+
- init: yarn install && yarn run builds

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"prebump": "run-s lint test",
1717
"prepublishOnly": "yarn run build",
1818
"test": "cross-env BABEL_OUTPUT=commonjs jest",
19-
"start": "webpack serve --allowed-hosts all --static-directory examples --port 8000",
19+
"start": "webpack serve",
2020
"website": "run-s website:clean website:build website:redirect",
2121
"website:clean": "rimraf examples/dist",
2222
"website:build": "cross-env BABEL_TARGET=examples NODE_ENV=production webpack",

webpack.config.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ const isDev = process.env.NODE_ENV !== 'production';
1010

1111
const plugins = [
1212
new HtmlWebpackPlugin({
13-
filename: 'index.html',
1413
inject: true,
1514
template: path.resolve(sourceDirectory, 'index.html'),
1615
minify: {
@@ -44,7 +43,14 @@ module.exports = {
4443
chunkFilename: 'chunk-[chunkhash].js',
4544
filename: '[name]-[chunkhash].js',
4645
hashDigestLength: 8,
47-
publicPath: './',
46+
publicPath: '/',
47+
},
48+
devServer: {
49+
static: {
50+
directory: targetDirectory,
51+
},
52+
allowedHosts: ['localhost', '.gitpod.io'],
53+
port: 8000,
4854
},
4955
module: {
5056
rules: [

0 commit comments

Comments
 (0)