vue.config.js esm support
patarapolw opened this issue ยท 5 comments
patarapolw commented
What problem does this feature solve?
Instead of
require = require("esm")(module);
const { pugFilters } = require("./src/plugins/render");
I can do import { .pugFilter } from "./src/plugins/render"
directly.
Note that I have to do ES6 import from source to enable import in other places in TypeScript.
This is to be on par with Webpack Node API
What does the proposed API look like?
// vue.config.js
import { .pugFilter } from "./src/plugins/render";
sodatea commented
There are two possible outcomes for this issue:
- For support of a custom module format without changing the file extension, we'd preload a module loader before requiring the config file. We may implement a CLI option for this feature, like the
config-register
option inwebpack-cli
. - For support of a custom module format with a custom file extension, we can use the
interpret
package.
corydorning53 commented
is there plans to allow this now that node v14+ allows esm?
gmichaeljaison commented
Is this released yet? Which version of vue-cli
supports this?
kid1412621 commented
Is this released yet? Which version of
vue-cli
supports this?
I managed to change filename to vue.config.mjs
to use esm. It could work. But somehow the settings about css in the file doesn't take effect.
JinPengGeng commented
is there any update for esm support ??