remote-file-webpack-plugin

1.0.2 • Public • Published

Remote File Webpack Plugin

What it does

Webpack 4 plugin to download remote files and save them in Webpack compilation, so they can be served locally.

Requirements

  • Webpack 4
  • Node >= 10.12

Install

npm install remote-file-webpack-plugin --save-dev

Usage

const RemoteFilePlugin = require('remote-file-webpack-plugin');
 
module.exports = {
  plugins: [
    new RemoteFilePlugin([
      {
        url: 'https://fonts.googleapis.com/css?family=Open+Sans:300,400,600,700,800|Roboto:100,300,400,500,700,900',
        filepath: 'styles/fonts.css',
        cache: true
      },
    ])
  ]
}

Options

You can pass in either an object, or an array of objects for downloading multiple files.

  • url (string): URL of the remote file
  • filepath (string): path, relative to your local output.path, where the file will be saved
  • cache (boolean): wether or not to use cache so you don't have to download same file multiple times (node_modules\.cache\remote-file-webpack-plugin)

Dependencies (1)

Dev Dependencies (0)

    Package Sidebar

    Install

    npm i remote-file-webpack-plugin

    Weekly Downloads

    173

    Version

    1.0.2

    License

    MIT

    Unpacked Size

    4.25 kB

    Total Files

    3

    Last publish

    Collaborators

    • brugarolas