New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

webpack-plugin-cdn-free

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

webpack-plugin-cdn-free

Traversal encapsulation of the webpack output file

latest
Source
npmnpm
Version
1.0.19
Version published
Maintainers
1
Created
Source

webpack-plugin-cdn-free

Traversal encapsulation of the webpack output file

Install

$ npm i webpack-plugin-cdn-free --save-dev

Conifg

const webpack = require('webpack'); //to access built-in plugins
var CdnWebpack = require('webpack-plugin-cdn-free')

module.exports = {
  module: {
    rules: [
      { test: /\.txt$/, use: 'raw-loader' }
    ]
  },
  plugins: [
    new CdnWebpack({
      callback:function(fileName,localPath){
        // custom cdn ...
        return true // Returning false interrupts
      },
      publicPath: "http://example.com", // cdn domain names
      prefixPath: "prefixPath", // The url common prefix that needs to be passed to the CDN
    })
    ...
  ]
};

ignore

If need to use the CDN file exclusion. You need to create a new file ".cdnignore"

./.cdnignore

index.html
dist/statis/*

Exclude the rules:here

Introduction

  • This plug-in supports only one CDN domain
  • There may be problems with prefix configuration and domain name configuration failure, please be sure to use problems. issue
  • The existing policy of this plug-in will interrupt the whole process in case of failure for any reason to ensure the quality of release.
  • If you encounter packaged output that is not completely generated from the configured extension, you need to check yourself to see if it is really missing.

Questions & Suggestions

Please open an issue here.

License

MIT

Keywords

webpack-plugin

FAQs

Package last updated on 10 Oct 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts