WebStormRequireJsPlugin
WebStormRequireJsPlugin copied to clipboard
`paths` in config file is ignored
My config file:
requirejs.config({
baseUrl: '/js',
paths: {
'jquery': '/js/deps/jquery-3.1.1.min'
}
});
requirejs(['src/main']);
example.js
define([
'jquery' // <-- appears red, broken.
], function ($) {
});
This is a basic feature of Require.js and without the configuration being used/parsed this plugin is not really useful, since most of the auto-completions will not work when using the paths or shim configuration. This is especially important in frameworks, where the JS files are spread across several root-folder (i.e. Magento or TYPO3-Backend).
Well I'm moving away from AMD anyway, as browsers started to support ES6 already, so dev env is easy. And in production you most probably take a babelified version.