Skip to content

Commit

Permalink
fix(example): roll back unneeded package json changes
Browse files Browse the repository at this point in the history
  • Loading branch information
haweston committed Nov 3, 2023
1 parent 20b7c57 commit 39f8324
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 366 deletions.
3 changes: 1 addition & 2 deletions examples/react-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@
"rollup-plugin-node-polyfills": "^0.2.1",
"sass": "^1.63.4",
"typescript": "^4.8.3",
"vite": "^4.4.9",
"vite-plugin-dynamic-import": "1.5.0"
"vite": "^4.4.3"
}
}
22 changes: 0 additions & 22 deletions examples/react-app/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,28 +9,6 @@ export default defineConfig(() => {
},
assetsInclude: ['**/*.hdr'],
plugins: [
/**
* This plugin is required to resolve the charts-core module as they are dynamically imported
* when the library is loaded.
* See the dynamic loading code here: https://github.com/ionic-team/stencil/blob/main/src/client/client-load-module.ts#L32
* Unfortunately, we are using an older version of the stencil library which doesn't use the syntax vite supports to
* detect the dynamic imports automatically, so we need to use this plugin to explicitly tell vite to include the
* charts-core module otherwise their code will not be included in the build.
*/
dynamicImport({
filter(id) {
// `node_modules` is exclude by default, so we need to include it explicitly
// https://github.com/vite-plugin/vite-plugin-dynamic-import/blob/v1.3.0/src/index.ts#L133-L135
if (id.includes('/node_modules/@iot-app-kit/charts-core')) {
console.log('dynamically import entry point', id);
return true;
}
},
onFiles(files) {
console.log('dynamically import files', files);
}
}),
// required to support the commonjs require in dev builds
react({
// Use React plugin in all *.jsx and *.tsx files
include: '**/*.{jsx,tsx}'
Expand Down

0 comments on commit 39f8324

Please sign in to comment.