Socket
Socket
Sign inDemoInstall

uglify-template-string-loader

Package Overview
Dependencies
0
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    uglify-template-string-loader

Removes spaces and line breaks in ES Template Strings.


Version published
Weekly downloads
236
increased by10.8%
Maintainers
1
Install size
3.53 kB
Created
Weekly downloads
 

Readme

Source

uglify-template-string-loader

Removes spaces and line breaks in ES Template Strings.

before:

let example = () => `
    <div class="test test-class">
        <h1>title h1</h1>
        <p> description </p>
        <div>
            text     text 2
            <span>span text</span>
        </div>
    </div>
`;

after:

let example = () => `<div class="test test-class"><h1>title h1</h1><p>description</p><div>text text 2<span>span text</span></div></div>`;

Install

npm install uglify-template-string-loader --save-dev

Usage

Add the loader to the webpack config.

If you are using a babel-loader, then the uglify-template-string-loader should be connected to it before it.

Examples

module.exports = {
    // ...
    module: {
        rules: [
            {
                test: /\.js$/,
                exclude: /node_modules/,
                use: [{
                    loader: 'uglify-template-string-loader'
                }]
            }
        ]
    }
};
module.exports = {
    // ...
    module: {
        rules: [
            {
                test: /\.js$/,
                exclude: /node_modules/,
                use: [
                    'babel-loader',
                    'uglify-template-string-loader'
                ]
            }
        ]
    }
};

Keywords

FAQs

Last updated on 24 Sep 2017

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc