Skip to content

Commit

Permalink
Merge branch 'master' into bpenkov/wc-proj-opt
Browse files Browse the repository at this point in the history
  • Loading branch information
Lipata authored Feb 15, 2022
2 parents 9824ae8 + 84ca125 commit 14c431b
Show file tree
Hide file tree
Showing 3 changed files with 109 additions and 86 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@
"./$(dash-name).js": "./dist/src/$(dash-name).js"
},
"scripts": {
"start": "tsc && concurrently --kill-others \"tsc -w\" \"wds\"",
"build": "webpack --mode production",
"start": "tsc && concurrently -k -r \"tsc --watch\" \"wds\"",
"build": "rimraf dist && tsc && rollup -c rollup.config.mjs",
"start:build": "web-dev-server --root-dir dist --app-index index.html --open",
"lint": "eslint --ext .js,.ts,.html . --ignore-path .gitignore",
"test": "tsc && wtr"
},
"dependencies": {
"@open-wc/testing": "^2.5.33",
"@vaadin/router": "^1.7.4",
"igniteui-webcomponents": "2.0.0",
"igniteui-webcomponents-grids": "~1.4.1",
Expand All @@ -31,33 +31,33 @@
"igniteui-dockmanager": "~1.6.0",
"@igniteui/material-icons-extended": "^2.10.0",
"lit": "^2.0.2",
"typescript": "^4.5.2",
"babel-runtime": "^6.26.0"
"typescript": "^4.5.2"
},
"devDependencies": {
"@babel/preset-env": "^7.16.4",
"@open-wc/testing": "^2.5.33",
"@open-wc/building-rollup": "^2.0.1",
"@rollup/plugin-babel": "^5.3.0",
"@rollup/plugin-node-resolve": "^13.0.6",
"rollup-plugin-copy-assets": "^2.0.3",
"@open-wc/eslint-config": "^4.3.0",
"@typescript-eslint/eslint-plugin": "^4.30.0",
"@typescript-eslint/parser": "^4.30.0",
"@web/dev-server": "^0.1.22",
"@web/rollup-plugin-html": "^1.10.1",
"@web/rollup-plugin-import-meta-assets": "^1.0.7",
"babel-plugin-template-html-minifier": "^4.1.0",
"@web/test-runner": "next",
"igniteui-cli": "~$(cliVersion)",
"concurrently": "^6.3.0",
"deepmerge": "^4.2.2",
"rimraf": "^3.0.2",
"rollup": "^2.60.0",
"rollup-plugin-terser": "^7.0.2",
"rollup-plugin-workbox": "^6.2.0",
"eslint": "^7.32.0",
"tslib": "^2.3.1",
"@babel/cli": "^7.16.0",
"@babel/core": "^7.16.0",
"@babel/plugin-proposal-class-properties": "^7.16.0",
"@babel/plugin-transform-runtime": "^7.16.4",
"@babel/preset-env": "^7.16.4",
"@babel/preset-typescript": "^7.16.0",
"@types/source-map": "^0.5.7",
"babel-loader": "^8.2.3",
"babel-plugin-transform-custom-element-classes": "^0.1.0",
"fork-ts-checker-webpack-plugin": "^6.4.2",
"html-webpack-plugin": "^5.5.0",
"source-map": "^0.7.3",
"webpack": "^5.64.2",
"webpack-cli": "^4.9.1"
"source-map": "^0.7.3"
},
"eslintConfig": {
"parser": "@typescript-eslint/parser",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
import nodeResolve from '@rollup/plugin-node-resolve';
import babel from '@rollup/plugin-babel';
import copy from 'rollup-plugin-copy-assets';
import { rollupPluginHTML as html } from '@web/rollup-plugin-html';
import { importMetaAssets } from '@web/rollup-plugin-import-meta-assets';
import { terser } from 'rollup-plugin-terser';
import { generateSW } from 'rollup-plugin-workbox';
import path from 'path';

export default {
input: 'index.html',
output: {
entryFileNames: '[hash].js',
chunkFileNames: '[hash].js',
assetFileNames: '[hash][extname]',
format: 'es',
dir: 'dist',
},
preserveEntrySignatures: false,

plugins: [
copy({
assets: [
'src/assets',
],
}),
/** Enable using HTML as rollup entrypoint */
html({
minify: true,
injectServiceWorker: true,
serviceWorkerPath: 'dist/sw.js',
}),
/** Resolve bare module imports */
nodeResolve(),
/** Minify JS */
terser(),
/** Bundle assets references via import.meta.url */
importMetaAssets(),
/** Compile JS to a lower language target */
babel.babel({
babelHelpers: 'bundled',
presets: [
[
'@babel/preset-env',
{
targets: [
'last 3 Chrome major versions',
'last 3 Firefox major versions',
'last 3 Edge major versions',
'last 3 Safari major versions',
],
modules: false,
bugfixes: true,
},
],
],
plugins: [
[
'babel-plugin-template-html-minifier',
{
modules: { lit: ['html', { name: 'css', encapsulation: 'style' }] },
failOnError: false,
strictCSS: true,
htmlMinifier: {
collapseWhitespace: true,
conservativeCollapse: true,
removeComments: true,
caseSensitive: true,
minifyCSS: true,
},
},
],
],
}),
/** Create and inject a service worker */
generateSW({
globIgnores: ['polyfills/*.js', 'nomodule-*.js'],
navigateFallback: '/index.html',
// where to output the generated sw
swDest: path.join('dist', 'sw.js'),
// directory to match patterns against to be precached
globDirectory: path.join('dist'),
// cache any html js and css by default
globPatterns: ['**/*.{html,js,css,webmanifest}'],
skipWaiting: true,
clientsClaim: true,
runtimeCaching: [{ urlPattern: 'polyfills/*.js', handler: 'CacheFirst' }],
}),
],
};

This file was deleted.

0 comments on commit 14c431b

Please sign in to comment.