-
Notifications
You must be signed in to change notification settings - Fork 307
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
Add AMD/RequireJS and CommonJS #264
base: master
Are you sure you want to change the base?
Conversation
We need this one for sure! |
agreed! |
please merge this pull request! |
If you're still waiting for this merge and using Webpack 2 you can use exports-loader I've included slidebars using exports-loader and the webpack provide plugin: ...
new Webpack.ProvidePlugin({
slidebars: 'exports-loader?slidebars!slidebars/dist/slidebars',
}),
... This makes sidebars globally available, which can be initialized like so: $(document).ready(() => {
const controller = new slidebars()
controller.init()
}) |
@Nubuck : Thanks, it's works well ! |
Any plan of merging this? Seems like a much needed feature! |
If you don't want to use the plugin @Nubuck mentions above, you can depend on my fork which includes CommonJS/AMD support and plays nice with webpack out of the box. Just change your
And then |
I have sent an email to Adam (owner / creator) to ask if he can merge this request! 🤞 |
Another way to import slidebars instead of using the provide plugin to make it globally available (which I find a bit too magical), you can:
Note sure if it's best practice or not though. |
This PR add support for AMD/RequireJS and CommonJS.
Now we can use this script with npm, webpack,... :
Fix the issue #256 and partially the #122 without break the actual code