https://www.npmjs.com/package/webpack-virtual-modules
var virtualModules = new VirtualModulesPlugin({
'node_modules/module-foo.js': 'module.exports = { foo: "foo" };',
'node_modules/module-bar.js': 'module.exports = { bar: "bar" };'
});
module.exports = {
// ...
plugins: [
virtualModules
]
};
I would like to add a node module to my app
node_modules/axios :
https://cdnjs.cloudflare.com/ajax/libs/axios/1.7.7/axios.min.js
just wanted to add bundled node modules to my app
like vue2, lodash ,Moment.js,vue-loader ,vue-template-compiler, axios etc
yea I know about the externals in webpack.config that can’t be used in this case as I need to add vue-loader and vue-template-compiler in my virtual node modules