Switch to webpack
This commit is contained in:
parent
5e0dfaf13d
commit
4b11073437
17 changed files with 238 additions and 69 deletions
25
openscad-worker.rollup.config.js
Normal file
25
openscad-worker.rollup.config.js
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
import typescript from 'rollup-plugin-typescript';
|
||||
import replace from '@rollup/plugin-replace';
|
||||
import packageConfig from './package.json'
|
||||
|
||||
const LOCAL_URL = process.env.LOCAL_URL ?? 'http://localhost:4000/';
|
||||
const PUBLIC_URL = process.env.PUBLIC_URL ?? packageConfig.homepage;
|
||||
|
||||
export default [
|
||||
{
|
||||
input: 'src/openscad-worker.ts',
|
||||
output: {
|
||||
file: 'dist/openscad-worker.js',
|
||||
format: 'es'
|
||||
},
|
||||
plugins: [
|
||||
typescript({
|
||||
rootDir: 'src',
|
||||
}),
|
||||
replace({
|
||||
preventAssignment: true,
|
||||
'import.meta.url': JSON.stringify(process.env.NODE_ENV !== 'production' ? LOCAL_URL : PUBLIC_URL),
|
||||
})
|
||||
]
|
||||
},
|
||||
];
|
||||
Loading…
Reference in a new issue