Help with script-loader and using in webpack config / es2015 imports ?
iangregsondev opened this issue · 1 comments
iangregsondev commented
Hi,
I found the script-loader and got it working using the example given using require. I am actually using a webpack.config and ES2015
Can anyone confirm if I can use this with
-
ES 2015 imports and how to do this?
-
Using webpack.config and adding it to the loaders sections
There seems to be little documentation.
Its worth noting that i am using multiple script-loaders currently like so (using the nodejs require syntax)
require("script-loader!../lib/packer.js");
require("script-loader!../lib/decompress.js");
require("script-loader!../lib/consol.js");
An example for the 2 ways of doing this above would really helpful.
Thanks in advance
michael-ciniawsky commented
@appsolutegeek
file.js
require('path/to/script.exec.js')
webpack.config.js
{
test: /\.exec\.js$/,
use: [ { loader: 'script-loader' } ]
}