Socket
Socket
Sign inDemoInstall

client-loader

Package Overview
Dependencies
0
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    client-loader

Webpack loader to allow module to be defined separately for client and server


Version published
Maintainers
1
Install size
3.71 kB
Created

Readme

Source

client-loader

Webpack loader to allow module to be defined separately for client and server.

Usage

Add two modules to your project, both similar in purpose. However, target one for the browser and the other for the server.

ScriptName.js
ScriptName.client.js

In the script that is dependant on that module require normally as require('ScriptName').

Add as final loader for your js, coffee, etc.


module.exports = {
  ...
  module: {
    loaders: [
      { test: /\.js$/, loader: 'client' }
    ]
  }
};

Webpack will bundle the ScriptName.client.js file and not the ScriptName.js file.

Keywords

FAQs

Last updated on 18 Mar 2015

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