$ gnpm install script-loader
npm install --save-dev script-loader
Executes JS script once in global context.
:warning: Doesn't work in NodeJS
import exec from 'script.exec.js';
webpack.config.js
module.exports = {
module: {
rules: [
{
test: /\.exec\.js$/,
use: [ 'script-loader' ]
}
]
}
}
import exec from 'script-loader!./script.js';
Juho Vepsäläinen | Joshua Wiens | Kees Kluskens | Sean Larkin |
Copyright 2013 - present © cnpmjs.org | Home |