Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

written for node_modules #13

Open
unjust opened this issue Apr 27, 2019 · 1 comment
Open

written for node_modules #13

unjust opened this issue Apr 27, 2019 · 1 comment

Comments

@unjust
Copy link

unjust commented Apr 27, 2019

I'm currently using webpack imports and exports loader to get this to work.
Can this be written with es6 exports ?
Maybe as a node_module as well?

@unjust
Copy link
Author

unjust commented Apr 28, 2019

Just a suggestion

In the meantime I'm doing this with webpack and it seems to work well

        rules: [
            {
                test: path.resolve(__dirname, 'libs/easycam/p5.easycam.js'),
                use: "imports-loader?p5=>require('p5')"
            },
            {
                // https://webpack.js.org/guides/shimming/#global-exports
                test: path.resolve(__dirname, 'libs/easycam/p5.easycam.js'),
                use: 'exports-loader?createEasyCam=p5.prototype.createEasyCam,EasyCamLib=Dw'
            },

then in my animation file

import { createEasyCam, EasyCamLib } from '../libs/easycam/p5.easycam.js';

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant