Skip to content

Commit 266bfb9

Browse files
nikkufake-join[bot]
authored andcommitted
chore: build using webpack
1 parent 263565a commit 266bfb9

File tree

6 files changed

+64
-124
lines changed

6 files changed

+64
-124
lines changed

.babelrc

-3
This file was deleted.

.eslintignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
dist/
1+
public

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
.DS_Store
22
node_modules
3-
dist
3+
public

Gruntfile.js

-104
This file was deleted.

package.json

+9-15
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,10 @@
1111
"lint": "eslint .",
1212
"auto-test": "npm test -- --auto-watch --no-single-run",
1313
"test": "karma start",
14-
"bundle": "grunt build",
15-
"dev": "grunt auto-build",
16-
"all": "run-s lint test bundle"
14+
"build": "webpack",
15+
"start": "run-s build serve",
16+
"dev": "run-p \"build -- --watch\" serve",
17+
"serve": "sirv public --dev"
1718
},
1819
"keywords": [
1920
"bpmnjs-example"
@@ -30,30 +31,23 @@
3031
],
3132
"license": "MIT",
3233
"devDependencies": {
33-
"babel-core": "^6.26.0",
34-
"babel-preset-env": "^1.6.1",
3534
"chai": "^4.3.10",
35+
"copy-webpack-plugin": "^11.0.0",
3636
"eslint": "^4.18.1",
3737
"eslint-plugin-bpmn-io": "^0.4.1",
38-
"grunt": "~0.4.4",
39-
"grunt-browserify": "^4.0.0",
40-
"grunt-cli": "^1.2.0",
41-
"grunt-contrib-connect": "~0.11.2",
42-
"grunt-contrib-copy": "~0.8.1",
43-
"grunt-contrib-watch": "~0.6.1",
4438
"karma": "^6.4.2",
4539
"karma-chai": "^0.1.0",
4640
"karma-chrome-launcher": "^3.2.0",
4741
"karma-firefox-launcher": "^2.1.2",
4842
"karma-mocha": "^2.0.1",
4943
"karma-webpack": "^5.0.0",
50-
"load-grunt-tasks": "~3.2.0",
5144
"mocha": "^10.2.0",
5245
"mocha-test-container-support": "^0.2.0",
53-
"npm-run-all": "^4.1.2",
46+
"npm-run-all": "^4.1.5",
5447
"puppeteer": "^21.5.0",
55-
"time-grunt": "^0.3.2",
56-
"webpack": "^5.89.0"
48+
"sirv-cli": "^2.0.2",
49+
"webpack": "^5.89.0",
50+
"webpack-cli": "^5.1.4"
5751
},
5852
"dependencies": {
5953
"bpmn-js": "^3.2.2",

webpack.config.js

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
const CopyPlugin = require('copy-webpack-plugin');
2+
3+
const path = require('path');
4+
5+
const basePath = '.';
6+
7+
const absoluteBasePath = path.resolve(path.join(__dirname, basePath));
8+
9+
module.exports = {
10+
mode: 'development',
11+
entry: './app/index.js',
12+
output: {
13+
path: path.resolve(__dirname, 'public'),
14+
filename: 'index.js'
15+
},
16+
devtool: 'source-map',
17+
module: {
18+
rules: [
19+
{
20+
test: /\.less$/i,
21+
use: [
22+
// compiles Less to CSS
23+
"style-loader",
24+
"css-loader",
25+
"less-loader",
26+
],
27+
},
28+
{
29+
test: /\.bpmn$/,
30+
type: 'asset/source'
31+
}
32+
]
33+
},
34+
resolve: {
35+
mainFields: [
36+
'browser',
37+
'module',
38+
'main'
39+
],
40+
modules: [
41+
'node_modules',
42+
absoluteBasePath
43+
]
44+
},
45+
plugins: [
46+
new CopyPlugin({
47+
patterns: [
48+
{ from: 'app/index.html', to: '.' },
49+
{ from: 'node_modules/bpmn-js/dist/assets', to: 'vendor/bpmn-js/assets' }
50+
]
51+
})
52+
]
53+
};

0 commit comments

Comments
 (0)