0.0.1 • Published 9 years ago

client-loader v0.0.1

Weekly downloads
3
License
MIT
Repository
github
Last release
9 years ago

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.