All Projects → tomasAlabes → webpack2-externals-plugin

tomasAlabes / webpack2-externals-plugin

Licence: MIT license
Webpack 2+ fork of Webpack-Externals-Plugin

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to webpack2-externals-plugin

crx-webpack-plugin
A webpack plugin to package chrome extensions (crx) post build
Stars: ✭ 21 (+50%)
Mutual labels:  webpack-plugin
chicio.github.io
👻 Fabrizio Duroni (me 😄) personal website. Created using GatsbyJS, Styled Components, Storybook, Typescript, tsParticles, GitHub pages, Github Actions, Upptime.
Stars: ✭ 20 (+42.86%)
Mutual labels:  webpack-plugin
size-plugin-bot
A Github bot for size-plugin
Stars: ✭ 76 (+442.86%)
Mutual labels:  webpack-plugin
qn-webpack
Qiniu webpack plugin (七牛 Webpack 插件)
Stars: ✭ 39 (+178.57%)
Mutual labels:  webpack-plugin
bower-resolve-webpack-plugin
Offers an enhanced bower support for enhanced-resolve plugin.
Stars: ✭ 12 (-14.29%)
Mutual labels:  webpack-plugin
webpack-alioss-upload-plugin
A flexible webpack plugin to upload files to aliyun oss, which supports multiple optional upload methods and parameters.
Stars: ✭ 14 (+0%)
Mutual labels:  webpack-plugin
image-minimizer-webpack-plugin
Webpack loader and plugin to compress images using imagemin
Stars: ✭ 180 (+1185.71%)
Mutual labels:  webpack-plugin
image-sprite-webpack-plugin
A webpack plugin that generates spritesheets from your stylesheets.
Stars: ✭ 27 (+92.86%)
Mutual labels:  webpack-plugin
targets-webpack-plugin
Webpack plugin for transcompilig final bundles so they support legacy browsers
Stars: ✭ 15 (+7.14%)
Mutual labels:  webpack-plugin
monaco-editor-esm-webpack-plugin
No description or website provided.
Stars: ✭ 25 (+78.57%)
Mutual labels:  webpack-plugin
mock-webpack-plugin
A webpack plugin that starts a json mock server
Stars: ✭ 21 (+50%)
Mutual labels:  webpack-plugin
warnings-to-errors-webpack-plugin
a webpack plugin that can recognize every warning as errors.
Stars: ✭ 17 (+21.43%)
Mutual labels:  webpack-plugin
loading-screen
🚥Loading screen for webpack plugin inspired by Nuxt.js's loading screen
Stars: ✭ 56 (+300%)
Mutual labels:  webpack-plugin
webpack-demos
webpack小练习
Stars: ✭ 17 (+21.43%)
Mutual labels:  webpack-plugin
css-chunks-html-webpack-plugin
Injecting css chunks extracted using extract-css-chunks-webpack-plugin to HTML for html-webpack-plugin
Stars: ✭ 22 (+57.14%)
Mutual labels:  webpack-plugin
del-webpack-plugin
A file plugin help you remove old files after webpack (v5) bundling
Stars: ✭ 43 (+207.14%)
Mutual labels:  webpack-plugin
remove-files-webpack-plugin
A plugin for webpack that removes files and folders before and after compilation.
Stars: ✭ 48 (+242.86%)
Mutual labels:  webpack-plugin
2018-package-three-webpack-plugin
[ARCHIVED] Webpack plugin to use Three.js "examples" classes
Stars: ✭ 45 (+221.43%)
Mutual labels:  webpack-plugin
prettier-eslint-webpack-plugin
Webpack plugin for prettier-eslint which ESLint's settings is set to JavaScript Standard Style
Stars: ✭ 24 (+71.43%)
Mutual labels:  webpack-plugin
webpack-stats-diff-plugin
Webpack plugin for reporting changes in bundle sizes across builds
Stars: ✭ 63 (+350%)
Mutual labels:  webpack-plugin

webpack2-externals-plugin (webpack 2+ supported)

This is a fork of webpack-externals-plugin, but that works in Webpack 2+!

Provides more powerful externals configuration options.

Usage

new ExternalsPlugin({ type, test, include, exclude }), where:

  • type represents the type of external (/var|this|commonjs2?|amd|umd/). Defaults to options.output.libraryTarget.
  • test, include, exclude work as they do with loader configuration.

Example

The following webpack configuration considers all modules under the local node_modules/ directory as externals.

webpack.config.js:

var ExternalsPlugin = require('webpack2-externals-plugin');
module.exports = {
  entry: './app.js',
  output: {
    path: __dirname + '/dist',
    filename: 'bundle.js',
  },
  plugins: [
    new ExternalsPlugin({
      type: 'commonjs',
      include: __dirname + '/node_modules',
    }),
  ],
};

Differences with options.externals

Webpack externals are only filtered depending on the user request (require('webpack') => webpack).

With this plugin, externals are filtered depending on the path of the resolved module (require('webpack') => <dir_path>/node_modules/webpack/lib/webpack.js).

This lets you include or exclude entire directories depending on the actual path of the resolved module.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].