Skip to content

Commit

Permalink
use webpack to make browser-ready JS.
Browse files Browse the repository at this point in the history
  • Loading branch information
EmileSonneveld committed Jun 6, 2021
1 parent 5574c8b commit 901c82b
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ coverage/
doc/
tmp/
lib/
dist/
.idea/
*.log
*.tgz
*.sh
11 changes: 11 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>serialise-to-js</title>
<script src="dist/main.js"></script>
</head>
<body>
Ctrl-Shift-I to open console
</body>
</html>
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,9 @@
"eslint-plugin-standard": "^4.0.1",
"mocha": "^7.0.1",
"nyc": "^15.0.0",
"rimraf": "^3.0.0"
"rimraf": "^3.0.0",
"webpack": "5.38.1",
"webpack-cli": "4.7.0"
},
"engines": {
"node": ">=4.0.0"
Expand Down
1 change: 1 addition & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,3 +159,4 @@ function serialize (source, opts = {}) {
}

module.exports = serialize
window.serialize = serialize
6 changes: 6 additions & 0 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
mode: 'none',
output: {
filename: 'main.js',
},
};

0 comments on commit 901c82b

Please sign in to comment.