Closed veleek closed 3 years ago
Please be sure, that your configuration files are correct. Have a look at the example folders.
Yeah, everything appears to be correct. I think it's probably more of a specific rollup issue, was just hoping maybe you had some insight into how it should work.
In case anybody else running into this problem, I'm hoping it'll be answered by this Stack Overflow thread.
You have to tell the 'rollup-commonjs-plugin' to convert your imported library's modules into a format Rollup can use:
In your rollup config edit the part concerning the commonjs-plugin:
commonjs({
include: [
'node_modules/eventemitter3/**',
'node_modules/phaser/**',
'node_modules/astar-typescript/**',
'node_modules/lodash/**',
],
exclude: [
'node_modules/phaser/src/polyfills/requestAnimationFrame.js',
],
sourceMap: true,
}),
I'm importing the package into a typescript project that's compiled with rollup. Unfortunately, when I try to build with this referenced (
import { AStarFinder } from "astar-typescript";
) rollup fails with the error:I've fiddled around with various plugin changes and options for
plugin-commonjs
(stuff like adding it to the includes list to force it to be parsed as a CommonJS module but nothing seems to work. Can someone help me figure out the incantation to get this working with rollup?This is more of a rollup question I suppose, but if you have any thoughts or ideas around ways to get it working that would be great!