script-loader

2018-10-12 admin

script-loader是什么

什么是script-loader,script loader module for webpack

script-loader使用教程帮助文档

npm node deps chat

<div align=“center”>

Script Loader

</div>

Install

npm install --save-dev script-loader

Usage

Executes JS script once in global context.

<g-emoji class=“g-emoji” alias=“warning” fallback-src=“https://assets-cdn.github.com/images/icons/emoji/unicode/26a0.png”>⚠️</g-emoji> Doesn’t work in NodeJS

Config (recommended)

import exec from 'script.exec.js';

webpack.config.js

module.exports = {
  module: {
    rules: [
      {
        test: /\.exec\.js$/,
        use: [ 'script-loader' ]
      }
    ]
  }
}

Inline

import exec from 'script-loader!./script.js';

Maintainers

| Juho Vepsäläinen | Joshua Wiens | Kees Kluskens | Sean Larkin |

你可能感兴趣的文章:

本站文章除注明转载外,均为本站原创或编译。欢迎任何形式的转载,但请务必注明出处。

转载请注明:文章转载自 JavaScript中文网 [https://www.javascriptcn.com]

本文地址:https://www.javascriptcn.com/read-42481.html

文章标题:script-loader

回到顶部