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 @@
<html>
<head>
<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>
<body>
......
......@@ -14,17 +14,21 @@ const pkg = require('./package.json');
const build = (typeof process.env.BUILD !== 'undefined') ? process.env.BUILD : 'local';
console.log("build: " + build);
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: {
file: 'dist/' + pkg.name + '.js',
format: 'esm'
dir: 'dist',
entryFileNames: '[name].js',
chunkFileNames: 'shared/[name].[hash].[format].js',
format: 'esm',
sourcemap: true
},
plugins: [
del({
targets: 'dist/*'
}),
multiEntry(),
(build == 'test') ? multiEntry() : false,
consts({
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