mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 02:11:05 +00:00
chore(examples): update typescript example
This commit is contained in:
parent
6e9f4d57e8
commit
efbb61b646
9 changed files with 328 additions and 101 deletions
|
@ -34,7 +34,7 @@ function serve() {
|
|||
}
|
||||
|
||||
export default {
|
||||
input: "src/main.ts",
|
||||
input: "src/index.ts",
|
||||
output: {
|
||||
sourcemap: true,
|
||||
format: "iife",
|
||||
|
@ -43,41 +43,18 @@ export default {
|
|||
},
|
||||
plugins: [
|
||||
svelte({
|
||||
// enable run-time checks when not in production
|
||||
dev: !production,
|
||||
// we'll extract any component CSS out into
|
||||
// a separate file - better for performance
|
||||
css: (css) => {
|
||||
css.write("public/build/bundle.css");
|
||||
},
|
||||
preprocess: sveltePreprocess(),
|
||||
css: (css) => {
|
||||
css.write("bundle.css");
|
||||
},
|
||||
}),
|
||||
|
||||
// If you have external dependencies installed from
|
||||
// npm, you'll most likely need these plugins. In
|
||||
// some cases you'll need additional configuration -
|
||||
// consult the documentation for details:
|
||||
// https://github.com/rollup/plugins/tree/master/packages/commonjs
|
||||
resolve({
|
||||
browser: true,
|
||||
dedupe: ["svelte"],
|
||||
}),
|
||||
resolve({ browser: true, dedupe: ["svelte"] }),
|
||||
commonjs(),
|
||||
typescript({ sourceMap: !production }),
|
||||
|
||||
// In dev mode, call `npm run start` once
|
||||
// the bundle has been generated
|
||||
typescript({ sourceMap: !production, inlineSources: !production }),
|
||||
!production && serve(),
|
||||
|
||||
// Watch the `public` directory and refresh the
|
||||
// browser on changes when not in production
|
||||
!production && livereload("public"),
|
||||
|
||||
// If we're building for production (npm run build
|
||||
// instead of npm run dev), minify
|
||||
production && terser(),
|
||||
],
|
||||
watch: {
|
||||
clearScreen: false,
|
||||
},
|
||||
watch: { clearScreen: false },
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue