Open cameronbraid opened 4 years ago
If you use Node>=13.0.0
, webpack is reqired.
On 10
<=Node<13
, it is possible to run w/o webpack. (but not recommended)
*.mjs
.index.ts
import { SvgCanvas,
SvgCanvas2DGradient } from 'red-agate-svg-canvas/modules';
// NOTE: hack bad .d.ts definition for ESM.
import * as ChartJs_ from 'chart.js';
const ChartJs: typeof ChartJs_ = (ChartJs_ as any).default || ChartJs_;
See also: https://github.com/shellyln/mdne/blob/12f7e4d9a54d991f55390cdf0d8c8f806fad4e60/package.json#L49-L50 https://github.com/shellyln/menneu/blob/master/src/components/Chart.tsx https://github.com/shellyln/menneu/blob/master/package.json
I found an easy way - install esm and ts-node
to see it working, checkout my branch :
npm install
npm run run
Hi, @cameronbraid .
Thanks for your useful information.
I think it's a very good way to get started this example w/o webpack.
The latest commit can now be run without Webpack. b9da40b526b30ca71cae1239bf160ca545b02da9
npm run build
npm run start:v12
Node>=12.13.0
is required.
Is there any way to run this in node without using webpack ?