Package Exports
- create-functional-loader
- create-functional-loader/dist/index.cjs
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (create-functional-loader) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
create-functional-loader
This is a fork of simple-functional-loader but rewrite with Typescript for TypeStrong !
Use function as webpack loader option
Install
<npm|yarn|pnpm> i -D create-functional-loaderUsage
// webpack.config.js
const { createLoader } = require('create-functional-loader')
module.exports = {
//...
module: {
rules: [
{
test: /\.html$/,
use: [
createLoader(function(source, map) { // must be an "ES5" function!
// use "this" as loaderContext
return processHTML(source, map) // process source code.
})
]
}
]
}
}createLoader function will return UseEntry object:
{
loader: string,
options: object,
ident: string
}