1.0.1 • Published 4 years ago
shimport-loader v1.0.1
shimport-loader
Webpack loader that replaces import() with shimport() https://www.npmjs.com/package/shimport
Usage
Include the shimport script to create the global var __shimport__
.
E.g.,
<script src="https://unpkg.com/shimport"></script>
Then use the shimport-loader
in the webpack config.
// in webpack.config.js
...
module: {
rules: [
{
test: /\.m?js$/,
exclude: /(node_modules|bower_components)/,
use: {
loader: 'shimport-loader'
}
}
]
}
^ will replace the dynamic import()
expressions with __shimport__.load()
expressions.