mirror of
https://github.com/wailsapp/wails.git
synced 2025-05-19 02:19:31 +08:00
Fix svelte for Windows
This commit is contained in:
parent
1e1834158b
commit
89ed00d6ed
@ -7,18 +7,25 @@
|
||||
"start": "sirv public"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.11.6",
|
||||
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
|
||||
"@babel/plugin-transform-runtime": "^7.11.5",
|
||||
"@babel/preset-env": "^7.11.5",
|
||||
"@rollup/plugin-commonjs": "^14.0.0",
|
||||
"@rollup/plugin-image": "^2.0.5",
|
||||
"@rollup/plugin-image": "^2.0.5",
|
||||
"@rollup/plugin-node-resolve": "^8.0.0",
|
||||
"core-js": "^3.6.5",
|
||||
"rollup": "^2.3.4",
|
||||
"rollup-plugin-babel": "^4.4.0",
|
||||
"rollup-plugin-livereload": "^2.0.0",
|
||||
"rollup-plugin-polyfill": "^3.0.0",
|
||||
"rollup-plugin-svelte": "^6.0.0",
|
||||
"rollup-plugin-terser": "^7.0.0",
|
||||
"svelte": "^3.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"sirv-cli": "^1.0.0",
|
||||
"@wailsapp/runtime": "^1.0.10",
|
||||
"svelte-simple-modal": "^0.6.0"
|
||||
"@wailsapp/runtime": "^1.0.10",
|
||||
"svelte-simple-modal": "^0.6.0"
|
||||
}
|
||||
}
|
||||
|
@ -4,6 +4,8 @@ import commonjs from '@rollup/plugin-commonjs';
|
||||
import livereload from 'rollup-plugin-livereload';
|
||||
import { terser } from 'rollup-plugin-terser';
|
||||
import image from '@rollup/plugin-image';
|
||||
import babel from 'rollup-plugin-babel';
|
||||
import polyfill from 'rollup-plugin-polyfill';
|
||||
|
||||
const production = !process.env.ROLLUP_WATCH;
|
||||
|
||||
@ -67,6 +69,37 @@ export default {
|
||||
// browser on changes when not in production
|
||||
!production && livereload('public'),
|
||||
|
||||
// Credit: https://blog.az.sg/posts/svelte-and-ie11/
|
||||
babel({
|
||||
extensions: [ '.js', '.jsx', '.es6', '.es', '.mjs', '.svelte', '.html' ],
|
||||
runtimeHelpers: true,
|
||||
exclude: [ 'node_modules/@babel/**', 'node_modules/core-js/**' ],
|
||||
presets: [
|
||||
[
|
||||
'@babel/preset-env',
|
||||
{
|
||||
targets: '> 0.25%, not dead, IE 11',
|
||||
modules: false,
|
||||
spec: true,
|
||||
useBuiltIns: 'usage',
|
||||
forceAllTransforms: true,
|
||||
corejs: 3,
|
||||
},
|
||||
|
||||
]
|
||||
],
|
||||
plugins: [
|
||||
'@babel/plugin-syntax-dynamic-import',
|
||||
[
|
||||
'@babel/plugin-transform-runtime',
|
||||
{
|
||||
useESModules: true
|
||||
}
|
||||
]
|
||||
]
|
||||
}),
|
||||
polyfill(['@webcomponents/webcomponentsjs']),
|
||||
|
||||
// If we're building for production (npm run build
|
||||
// instead of npm run dev), minify
|
||||
production && terser()
|
||||
|
Loading…
Reference in New Issue
Block a user