minor: dynamic npm imports

This commit is contained in:
Jean-Baptiste Pasquier
2021-07-05 18:05:23 +02:00
parent 65232573c1
commit cf1add07cb
11 changed files with 248 additions and 176 deletions

View File

@ -1,8 +1,8 @@
const HTMLAsset = require('parcel-bundler/lib/assets/HTMLAsset')
function shouldIgnore (file) {
// Ignore img(src="${...}") on pug & keep the components folder pristine
return /\${.+}/.test(file) || /components/.test(file) || /\/lib\/solid-/.test(file) || /\/lib\/sib-/.test(file);
// Ignore img(src="${...}") on pug
return /\${.+}/.test(file)
}
class SkipStartinbloxWidgetAsset extends HTMLAsset {

View File

@ -63,9 +63,6 @@ const options = {
await fse.copy("./src/locales", "./dist/locales")
console.log(`Copied locales to dist folder`);
await fse.copy("./src/components", "./dist/components")
console.log(`Copied components to dist folder`);
const bundler = new Bundler('./src/index.pug', options);
bundler.addAssetType('html', require.resolve('./assets.js'));
if (process.env.NODE_ENV !== 'production') {