1.0.1 • Published 7 years ago

ensure-script-loader v1.0.1

Weekly downloads
3
License
ISC
Repository
github
Last release
7 years ago

ensure-script-loader

use glob to get script resources

Install

npm install --save-dev ensure-script-loader

Usage

var scripts = require("ensure-script-loader?pattern=./modules/**/*.js!");
scripts["./modules/first.js"]().then((first)=>{
    console.log(first);
});

notes

Although this is a'loader', it does not need to be passed in the source, so the parameters introduced in the'require' end with "!".

Options

nametypedefaultdescription
patternstringundefinedResource path
optionsobjectundefinedglob options

pattern:Using glob pattern,it is the relative path to the value of context in webpack.