2021-08-03 15:10:33 +00:00
|
|
|
// eslint-disable-next-line node/no-unpublished-import
|
2021-12-28 14:02:29 +00:00
|
|
|
import { fromRollup } from '@web/dev-server-rollup'
|
2021-05-12 19:05:34 +00:00
|
|
|
// eslint-disable-next-line node/no-unpublished-import
|
2021-12-28 14:02:29 +00:00
|
|
|
import rollupCommonjs from '@rollup/plugin-commonjs'
|
2021-12-03 22:13:20 +00:00
|
|
|
// eslint-disable-next-line node/no-unpublished-import
|
2021-12-28 14:02:29 +00:00
|
|
|
import rollupHtml from 'rollup-plugin-html'
|
2021-05-09 17:29:45 +00:00
|
|
|
|
2021-12-28 14:02:29 +00:00
|
|
|
const commonjs = fromRollup(rollupCommonjs)
|
|
|
|
const html = fromRollup(rollupHtml)
|
2021-05-09 17:29:45 +00:00
|
|
|
|
|
|
|
export default {
|
2021-12-03 22:13:20 +00:00
|
|
|
mimeTypes: {
|
|
|
|
// serve imported html files as js
|
|
|
|
'src/editor/panels/*.html': 'js',
|
|
|
|
'src/editor/templates/*.html': 'js',
|
|
|
|
'src/editor/dialogs/*.html': 'js',
|
2021-12-04 10:30:29 +00:00
|
|
|
'src/editor/extensions/*/*.html': 'js',
|
|
|
|
'instrumented/editor/panels/*.html': 'js',
|
|
|
|
'instrumented/editor/templates/*.html': 'js',
|
|
|
|
'instrumented/editor/dialogs/*.html': 'js',
|
|
|
|
'instrumented/editor/extensions/*/*.html': 'js'
|
2021-12-03 22:13:20 +00:00
|
|
|
},
|
2021-05-09 17:29:45 +00:00
|
|
|
plugins: [
|
2021-12-28 14:02:29 +00:00
|
|
|
html({
|
|
|
|
include: [
|
|
|
|
'src/editor/panels/*.html',
|
|
|
|
'src/editor/templates/*.html',
|
|
|
|
'src/editor/dialogs/*.html',
|
|
|
|
'src/editor/extensions/*/*.html',
|
|
|
|
'instrumented/editor/panels/*.html',
|
|
|
|
'instrumented/editor/templates/*.html',
|
|
|
|
'instrumented/editor/dialogs/*.html',
|
|
|
|
'instrumented/editor/extensions/*/*.html'
|
|
|
|
]
|
|
|
|
}),
|
2021-05-09 17:29:45 +00:00
|
|
|
commonjs({
|
2021-11-17 18:53:20 +00:00
|
|
|
// explicitely list packages to increase performance
|
|
|
|
include: [
|
|
|
|
'**/node_modules/rgbcolor/**/*',
|
|
|
|
'**/node_modules/raf/**/*',
|
|
|
|
'**/node_modules/font-family-papandreou/**/*',
|
|
|
|
'**/node_modules/svgpath/**/*',
|
|
|
|
'**/node_modules/cssesc/**/*',
|
|
|
|
'**/node_modules/core-js/**/*',
|
|
|
|
'**/node_modules/performance-now/**/*'
|
|
|
|
]
|
2021-05-09 17:29:45 +00:00
|
|
|
})
|
|
|
|
]
|
2021-12-28 14:02:29 +00:00
|
|
|
}
|