client-loader

0.0.1 • Public • Published

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.

/client-loader/

    Package Sidebar

    Install

    npm i client-loader

    Weekly Downloads

    3

    Version

    0.0.1

    License

    MIT

    Last publish

    Collaborators

    • mtscout6