migration to vite/playwright
This commit is contained in:
@@ -51,7 +51,7 @@
|
||||
]
|
||||
},
|
||||
"scripts": {
|
||||
"build": "rollup -c",
|
||||
"build": "vite build",
|
||||
"prebuild": "standard . && npm i",
|
||||
"prepublishOnly": "npm run build"
|
||||
}
|
||||
|
||||
@@ -1,38 +0,0 @@
|
||||
/* eslint-env node */
|
||||
// This rollup script is run by the command:
|
||||
// 'npm run build'
|
||||
|
||||
import { rimraf } from 'rimraf'
|
||||
import babel from '@rollup/plugin-babel'
|
||||
import { nodeResolve } from '@rollup/plugin-node-resolve'
|
||||
import commonjs from '@rollup/plugin-commonjs'
|
||||
|
||||
// import progress from 'rollup-plugin-progress';
|
||||
import filesize from 'rollup-plugin-filesize'
|
||||
|
||||
// remove existing distribution
|
||||
await rimraf('./dist')
|
||||
console.info('recreating dist')
|
||||
|
||||
// config for svgedit core module
|
||||
const config = [{
|
||||
input: ['./svgcanvas.js'],
|
||||
output: [
|
||||
{
|
||||
format: 'es',
|
||||
inlineDynamicImports: true,
|
||||
sourcemap: true,
|
||||
file: 'dist/svgcanvas.js'
|
||||
}
|
||||
],
|
||||
plugins: [
|
||||
nodeResolve({
|
||||
browser: true,
|
||||
preferBuiltins: false
|
||||
}),
|
||||
commonjs(),
|
||||
babel({ babelHelpers: 'bundled', exclude: [/\/core-js\//] }), // exclude core-js to avoid circular dependencies.
|
||||
filesize()
|
||||
]
|
||||
}]
|
||||
export default config
|
||||
20
packages/svgcanvas/vite.config.mjs
Normal file
20
packages/svgcanvas/vite.config.mjs
Normal file
@@ -0,0 +1,20 @@
|
||||
import { resolve } from 'node:path'
|
||||
import { defineConfig } from 'vite'
|
||||
|
||||
export default defineConfig({
|
||||
build: {
|
||||
outDir: 'dist',
|
||||
emptyOutDir: true,
|
||||
sourcemap: true,
|
||||
lib: {
|
||||
entry: resolve(__dirname, 'svgcanvas.js'),
|
||||
formats: ['es'],
|
||||
fileName: () => 'svgcanvas.js'
|
||||
},
|
||||
rollupOptions: {
|
||||
output: {
|
||||
inlineDynamicImports: true
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user