Skip to content
Snippets Groups Projects
Commit d712f68c authored by Reiter, Christoph's avatar Reiter, Christoph :snake:
Browse files

Use code splitting and create a normal and a demo bundle

parent 3fa40d24
No related branches found
No related tags found
No related merge requests found
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<html> <html>
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<script type="module" id="vpu-auth-src" src="vpu-auth.js"></script> <script type="module" id="vpu-auth-src" src="vpu-auth-demo.js"></script>
</head> </head>
<body> <body>
......
...@@ -14,17 +14,21 @@ const pkg = require('./package.json'); ...@@ -14,17 +14,21 @@ const pkg = require('./package.json');
const build = (typeof process.env.BUILD !== 'undefined') ? process.env.BUILD : 'local'; const build = (typeof process.env.BUILD !== 'undefined') ? process.env.BUILD : 'local';
console.log("build: " + build); console.log("build: " + build);
export default { export default {
input: (build != 'test') ? 'src/demo.js' : 'test/**/*.js', input: (build != 'test') ? ['src/vpu-auth.js', 'src/vpu-auth-demo.js'] : 'test/**/*.js',
output: { output: {
file: 'dist/' + pkg.name + '.js', dir: 'dist',
format: 'esm' entryFileNames: '[name].js',
chunkFileNames: 'shared/[name].[hash].[format].js',
format: 'esm',
sourcemap: true
}, },
plugins: [ plugins: [
del({ del({
targets: 'dist/*' targets: 'dist/*'
}), }),
multiEntry(), (build == 'test') ? multiEntry() : false,
consts({ consts({
environment: build, environment: build,
}), }),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment