Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

encoding-plugin

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

encoding-plugin

Control Webpacks output encoding

  • 1.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
299
decreased by-34.86%
Maintainers
1
Weekly downloads
 
Created
Source

Webpack Encoding Plugin

Take control over the encoding of emitted webpack assets. This can be useful, if the delivering webserver enforces a specific content-type, so that your js-code is not interpreted as utf-8 by the browser.

Usage

install module

npm install webpack-encoding-plugin

setup webpack config

const EncodingPlugin = require('webpack-encoding-plugin');
module.exports = {
    entry: './entry.js',
    output: {
        path: '../dist',
        filename: 'bundle.js'
    },
    plugins: [new EncodingPlugin({
        encoding: 'iso-8859-1'
    })]
};

Additional options:

test, include, exclude RegExp or array of RegExps to filter processed files (default test is /(\.js|\.css)($|\?)/i)

Encodings

The Plugin uses iconv-lite to handle the encoding. A list of supported encodings can be found here

Keywords

FAQs

Package last updated on 01 Aug 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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc