1.1.2-alpha.0 • Published 5 years ago
@what-src/typescript-plugin v1.1.2-alpha.0
@what-src/typescript-plugin
what-src typescript compiler plugin.
Check out the packages folder for more information.
Usage
First install the package from npm.
npm install @what-src/typescript-plugin --save-dev
via Webpack (recommended)
Via webpack.config.ts (or .json, .js, ...).
import devserver from 'webpack-dev-server'
import webpack from 'webpack'
import { whatSrcServerTsLoaderPlugin } from '@what-src/plugin'
import { WhatSrcServerWebpackPlugin } from '@what-src/plugin'
const config: webpack.Configuration & devserver.Configuration = {
mode: process.env.NODE_ENV,
module: {
rules: [
{
test: /\.tsx?$/,
use: [
{
loader: 'ts-loader',
options: {
getCustomTransformers: () => ({
before: [whatSrcServerTsLoaderPlugin()],
}),
},
},
],
},
],
},
plugins: [new WhatSrcServerWebpackPlugin()],
}
$ package.json
{
...
"scripts": {
...
"develop": "webpack-dev-server"
},
...
}
npm run develop
Planned Support
Example
Check out the example project for a more in depth setup.
License
1.1.2-alpha.0
5 years ago
1.1.0-alpha.0
5 years ago