Skip to content

Commit d8507d0

Browse files
authored
Merge pull request #167 from SharonStrats/feat/add-scripts
#166 add scripts and fix dev webpack
2 parents a3cfdaf + 92a4045 commit d8507d0

2 files changed

Lines changed: 14 additions & 1 deletion

File tree

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@
1515
"clean": "rm -rf lib",
1616
"build": "npm run clean && npm run build-dist",
1717
"build-dist": "webpack --progress",
18+
"dev": "sh -c 'npm run watch-dist & npm run start'",
19+
"watch:workspace": "npm run watch-dist",
20+
"watch-dist": "webpack --watch --progress",
1821
"lint": "eslint",
1922
"lint-fix": "eslint --fix",
2023
"test": "jest --no-coverage",

webpack.dev.config.mjs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import path from 'path'
12
import HtmlWebpackPlugin from 'html-webpack-plugin'
23
import NodePolyfillPlugin from 'node-polyfill-webpack-plugin'
34
import { moduleRules } from './webpack.module.rules.mjs'
@@ -6,6 +7,11 @@ export default [
67
{
78
mode: 'development',
89
entry: ['./dev/index.js'],
10+
output: {
11+
path: path.resolve(process.cwd(), 'lib'),
12+
filename: 'main.js',
13+
clean: false,
14+
},
915
plugins: [
1016
new HtmlWebpackPlugin({ template: './dev/index.html' }),
1117
new NodePolyfillPlugin()
@@ -26,7 +32,11 @@ export default [
2632
},
2733

2834
devServer: {
29-
static: ['./dev', './test']
35+
static: ['./dev', './test'],
36+
port: 9002,
37+
devMiddleware: {
38+
writeToDisk: false,
39+
},
3040
},
3141
devtool: 'source-map',
3242
},

0 commit comments

Comments
 (0)