I'm migrating/moving a project based on require.js to webpack v3. Since all my modules are using the following syntax:
define([modules,..], function(mod1,..)
Which declares which modules to use, and assigns the modules to the variables in the anonymous function. This seems to be deprecated since v2 of webpack. I can't find any information about this (except for the documentation for web pack v1).
Should I rewrite all my modules to the commonjs (including dependencies) or are there any smart way to use the AMD modules?
Help much appreciated :-) Regards
AMD never found much use outside of requirejs so likely you will need to convert. There are tools that will help:
There are caveats from (https://github.com/anodynos/uRequire/wiki/nodejs-Template):
For most projects this is not an issue.
You should be able to use the synchronous version of require. If using webpack2 you can use System.import or require.ensure
You will find webpack version of all of these plugins
This can be replicated with https://www.npmjs.com/package/babel-plugin-module-alias
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With