0.5.0 • Published 6 years ago

surplus-loader v0.5.0

Weekly downloads
43
License
MIT
Repository
github
Last release
6 years ago

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.

0.5.0

6 years ago

0.5.0-beta2

7 years ago

0.5.0-beta1

7 years ago

0.4.5

7 years ago

0.4.4

7 years ago

0.4.3

7 years ago

0.4.2

7 years ago

0.4.1

7 years ago

0.4.0

7 years ago