New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

surplus-loader

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

surplus-loader

A webpack loader for compiling Surplus JSX views

  • 0.5.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Webpack loader for Surplus applications

Installation

> npm install --save-dev surplus-loader

Usage

// webpack.config.js
...
module: {
    rules: [
        // if just using javascript
        { test: /\.jsx$/, loader: 'surplus-loader' },
        // if using with typescript
        { test: /\.tsx?$/, loader: 'surplus-loader!ts-loader' },
    ]
}
...

Here's an example of an entire webpack.config.js that uses typescript.

// webpack.config.js
module.exports = {
    entry: './src/main.ts',
    output: {
        filename: './dist/main.js'
    },
    resolve: {
        extensions: ['.ts', '.tsx', '.js']
    },
    module: {
        rules: [
            { test: /\.tsx?$/, loader: 'surplus-loader!ts-loader' },
        ]
    }
};

Note:

  1. surplus-loader runs after typescript, so that it's just compiling Javascript, not Typescript (surplus-preprocessor doesn't understand typescript).
  2. For the JSX to make it through typescript uncompiled, you must specify "jsx": "preserve" in your tsconfig.json.

Keywords

FAQs

Package last updated on 22 Feb 2018

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