Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

isomorphic-region-loader

Package Overview
Dependencies
Maintainers
1
Versions
88
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

isomorphic-region-loader

Isomorphic #region Loader A loader for webpack that lets you strip #regions code from bundle.

  • 0.0.1
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Isomorphic #region Loader

A loader for webpack that lets you strip #regions code from bundle.

Install

npm install --save-dev isomorphic-region-loader

Usage

This load is very helpfull if you wanna write isomorphic applications in javascript or typescript. Just specify region and this loader will cut it from bundle. Example:

import * as jquery from 'jquery'
//#region nodejs
import * as fs from 'fs'
//#endregion

class ExampleIsomorphicClass {
  ...
}

With webpack configuraiton below:

module.exports = {
  module: {
    rules: [
      {
        test: /\.ts$/,
        use: 'isomorphic-region-loader',
        options: { platform: 'browser' }  // 'borwser' default platform, also there is 'nodejs'
      }
    ]
  }
}

You will get:

import * as jquery from 'jquery'

class ExampleIsomorphicClass {
  ...
}

As result, code inside #region nodejs has been stripped. Also you can do similar things to your nodejs code and strip off browser things.

Inline

In your application

import {  ExampleIsomorphicClass } from '!isomorphic-region-loader!./isomorphic-class.ts';

FAQs

Package last updated on 30 Dec 2017

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc