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

Port to use code splitting; Rename entry point to the package name

parent 04ca30c7
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" src="bundle.js"></script> <script type="module" src="vpu-person-profile-demo.js"></script>
</head> </head>
<body> <body>
......
{ {
"element": "vpu-person-profile", "element": "vpu-person-profile",
"module_src": "person-profile.js", "module_src": "vpu-person-profile.js",
"name": { "name": {
"de": "Benutzerprofil", "de": "Benutzerprofil",
"en": "User profile" "en": "User profile"
......
{ {
"name": "vpu-person-profile", "name": "vpu-person-profile",
"version": "1.0.0", "version": "1.0.0",
"main": "src/index.js", "main": "src/vpu-person-profile.js",
"devDependencies": { "devDependencies": {
"karma": "^4.2.0", "karma": "^4.2.0",
"karma-chai": "^0.1.0", "karma-chai": "^0.1.0",
......
...@@ -14,16 +14,19 @@ const build = (typeof process.env.BUILD !== 'undefined') ? process.env.BUILD : ' ...@@ -14,16 +14,19 @@ const build = (typeof process.env.BUILD !== 'undefined') ? process.env.BUILD : '
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-person-profile.js', 'src/vpu-person-profile-demo.js'] : 'test/**/*.js',
output: { output: {
file: 'dist/bundle.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,
}), }),
...@@ -51,6 +54,7 @@ export default { ...@@ -51,6 +54,7 @@ export default {
copy({ copy({
targets: [ targets: [
{src: 'assets/index.html', dest: 'dist'}, {src: 'assets/index.html', dest: 'dist'},
{src: 'assets/vpu-person-profile.metadata.json', dest: 'dist'},
{src: 'node_modules/vpu-common/assets/icons/*.svg', dest: 'dist/local/vpu-common/icons'}, {src: 'node_modules/vpu-common/assets/icons/*.svg', dest: 'dist/local/vpu-common/icons'},
], ],
}), }),
......
import 'vpu-auth'; import './vpu-person-profile-demo.js';
import './person-profile-demo.js';
import './person-profile.js';
import 'vpu-auth';
import {i18n} from './i18n.js'; import {i18n} from './i18n.js';
import {css, html, LitElement} from 'lit-element'; import {css, html, LitElement} from 'lit-element';
import VPULitElement from 'vpu-common/vpu-lit-element'; import VPULitElement from 'vpu-common/vpu-lit-element';
import './person-profile.js'; import './vpu-person-profile.js';
import * as commonUtils from 'vpu-common/utils'; import * as commonUtils from 'vpu-common/utils';
import bulmaCSSPath from "bulma/css/bulma.min.css"; import bulmaCSSPath from "bulma/css/bulma.min.css";
import $ from 'jquery'; import $ from 'jquery';
......
import '../src/person-profile.js'; import '../src/vpu-person-profile.js';
import '../src/demo.js'; import '../src/demo.js';
describe('vpu-person-profile demo', () => { describe('vpu-person-profile demo', () => {
......
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