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

Use rollup-plugin-url for including css assets

This way we don't have to mirror the directory structure in packages
which vendor this package.
parent 89fecc18
No related branches found
No related tags found
No related merge requests found
packages/person-select/assets/favicon.ico

2.49 KiB

......@@ -3,24 +3,25 @@
"version": "1.0.0",
"main": "src/index.js",
"devDependencies": {
"chai": "^4.2.0",
"i18next-scanner": "^2.10.2",
"karma": "^4.2.0",
"karma-chai": "^0.1.0",
"karma-chrome-launcher": "^3.1.0",
"karma-mocha": "^1.3.0",
"mocha": "^6.2.0",
"node-sass": "^4.12.0",
"puppeteer": "^1.15.0",
"mocha": "^6.2.0",
"chai": "^4.2.0",
"rollup": "^1.11.3",
"rollup-plugin-commonjs": "^10.0.2",
"rollup-plugin-copy": "^3.1.0",
"rollup-plugin-json": "^4.0.0",
"rollup-plugin-multi-entry": "^2.1.0",
"rollup-plugin-node-resolve": "^5.2.0",
"rollup-plugin-replace": "^2.2.0",
"rollup-plugin-serve": "^1.0.1",
"rollup-plugin-terser": "^5.1.1",
"rollup-plugin-json": "^4.0.0",
"rollup-plugin-replace": "^2.2.0",
"rollup-plugin-multi-entry": "^2.1.0",
"i18next-scanner": "^2.10.2",
"rollup-plugin-url": "^2.2.2",
"vpu-auth": "file:./vendor/auth",
"vpu-common": "file:./vendor/common"
},
......
......@@ -7,6 +7,7 @@ import json from 'rollup-plugin-json';
import replace from "rollup-plugin-replace";
import serve from 'rollup-plugin-serve';
import multiEntry from 'rollup-plugin-multi-entry';
import url from "rollup-plugin-url"
const pkg = require('./package.json');
const build = (typeof process.env.BUILD !== 'undefined') ? process.env.BUILD : 'local';
......@@ -29,6 +30,14 @@ export default {
commonjs({
include: 'node_modules/**'
}),
url({
limit: 0,
include: [
"node_modules/select2/**/*.css",
],
emitFiles: true,
fileName: 'shared/[name].[hash][extname]'
}),
json(),
replace({
"process.env.BUILD": '"' + build + '"',
......@@ -37,12 +46,6 @@ export default {
copy({
targets: [
{src: 'assets/index.html', dest: 'dist'},
{src: 'assets/favicon.ico', dest: 'dist'},
],
}),
copy({
targets: [
{src: 'node_modules/select2/dist/css', dest: 'dist/select2'},
],
}),
(process.env.ROLLUP_WATCH === 'true') ? serve({contentBase: 'dist', host: '127.0.0.1', port: 8002}) : false
......
......@@ -8,6 +8,8 @@ import {html} from 'lit-element';
import {i18n} from './i18n.js';
import VPULitElementJQuery from 'vpu-common/vpu-lit-element-jquery';
import commonUtils from 'vpu-common/utils';
import select2CSSPath from 'select2/dist/css/select2.min.css';
select2(window, $);
......@@ -160,7 +162,7 @@ class PersonSelect extends VPULitElementJQuery {
}
render() {
const select2CSS = getAssetURL('select2/css/select2.min.css');
const select2CSS = getAssetURL(select2CSSPath);
return html`
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bulma/0.7.5/css/bulma.min.css">
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment