All Projects → cvgellhorn → path-replace-loader

cvgellhorn / path-replace-loader

Licence: MIT license
Path replace loader for webpack

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to path-replace-loader

Webpack Cdn Plugin
A webpack plugin that use externals of CDN urls for production and local node_modules for development
Stars: ✭ 306 (+2085.71%)
Mutual labels:  webpack2, webpack3
Es6 Webpack2 Starter
🚀 A template project for es6/7, webpack2/3, sass and postcss
Stars: ✭ 106 (+657.14%)
Mutual labels:  webpack2, webpack3
Awesome Webpack Cn
[印记中文](https://docschina.org/) - webpack 优秀中文文章
Stars: ✭ 3,611 (+25692.86%)
Mutual labels:  webpack2, webpack3
Easy Vue
Learn vueJS Easily 👻
Stars: ✭ 896 (+6300%)
Mutual labels:  webpack2, webpack3
Webpack Book
From apprentice to master (CC BY-NC-ND)
Stars: ✭ 2,372 (+16842.86%)
Mutual labels:  webpack2, webpack3
react-webpack-starter
A really simple boiler plate for creating react applications bundled by webpack (using ES6+, Babel, SASS and webpack development server) ⚛️
Stars: ✭ 86 (+514.29%)
Mutual labels:  webpack2, webpack3
Vue2 Vue Router2 Webpack2
《从零搭建 vue2 vue-router2 webpack4 工程》《从零搭建 vue2 vue-router2 webpack3 工程》《搭建 vue2 vue-router2 webpack3 多入口工程》
Stars: ✭ 90 (+542.86%)
Mutual labels:  webpack2, webpack3
tde-webpack-mjml-plugin
Webpack plugin for converting MJML files to HTML
Stars: ✭ 12 (-14.29%)
Mutual labels:  webpack2, webpack3
Iceberg
Front-End Boilerplate built with React + Babel + Webpack + SASS
Stars: ✭ 144 (+928.57%)
Mutual labels:  webpack2, webpack3
Svg Sprite Loader
Webpack loader for creating SVG sprites.
Stars: ✭ 1,822 (+12914.29%)
Mutual labels:  webpack2, webpack3
Serverless Webpack
Serverless plugin to bundle your lambdas with Webpack
Stars: ✭ 1,595 (+11292.86%)
Mutual labels:  webpack2, webpack3
Webpack2 Lessons
📖《webpack2 包教不包会》
Stars: ✭ 187 (+1235.71%)
Mutual labels:  loader, webpack2
Markdown Loader
markdown loader for webpack
Stars: ✭ 335 (+2292.86%)
Mutual labels:  loader, webpack2
webpack-boilerplate
Webpack 4 boilerplate (babel, eslint, prettier, jest, sass, postcss, hmr, browsersync)
Stars: ✭ 33 (+135.71%)
Mutual labels:  webpack2, webpack3
vue-number-keyboard
vue-number-keyboard是基于VUE实现的数字键盘插件,当前支持整数、小数数字输入、乱序键盘,demo中给出了常用的验证码、金额数字示例。数字键盘的大小包括字体尺寸支持响应式。
Stars: ✭ 51 (+264.29%)
Mutual labels:  webpack3
global-prefix
Get the npm global path prefix. Same code used internally by npm.
Stars: ✭ 27 (+92.86%)
Mutual labels:  path
proc-that
proc(ess)-that - easy extendable ETL tool for Node.js. Written in TypeScript.
Stars: ✭ 25 (+78.57%)
Mutual labels:  loader
idomizer
An HTML template parser compiling an incremental-dom render factory.
Stars: ✭ 15 (+7.14%)
Mutual labels:  loader
Solaris
A local LKM rootkit loader/dropper that lists available security mechanisms
Stars: ✭ 47 (+235.71%)
Mutual labels:  loader
commerce
🛒 e-commerce-platform
Stars: ✭ 54 (+285.71%)
Mutual labels:  webpack2

path-replace-loader for webpack

Path replace loader for webpack. Replace a given base path with another path for dynamic module loading. Great for large applications with locally overridable modules.

Installation

$ npm install path-replace-loader

Usage

Read more about using loaders

Configuration

  • path: Absolute original path to replace, e.g. __dirname/app/core
  • replacePath: Absolute replacement path, e.g. __dirname/app/local

webpack config

module.exports = {
  module: {
    rules: [
      {
          test: /\.js$/,
          loader: 'path-replace-loader',
          exclude: /(node_modules)/,
          options: {
              path: 'ORIGINAL_PATH',
              replacePath: 'REPLACE_PATH'
          }
      }
    ]
  }
};

Example

Loader tries to load from local directory if file exists app/local/modules/auth

const authModule = require('app/core/modules/auth');

Babel + webpack

Make sure to include this in your .babelrc, if you want to use Babel with webpack

{
    "presets": [
        ["es2015", { "modules": false }]
    ]
}

Release History

  • 2.0.0 - Bump packages and add webpack 3 support
  • 1.0.0 - Add webpack 2 support
  • 0.2.2 - Improve example
  • 0.2.1 - Update README
  • 0.2.0 - Use dependency to introduce file to webpack in order to make them watchable
  • 0.1.0 - Initial release

MIT License

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].