Socket
Socket
Sign inDemoInstall

@poi/plugin-typescript

Package Overview
Dependencies
326
Maintainers
3
Versions
31
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 12.1.0 to 12.2.0

10

CHANGELOG.md

@@ -6,2 +6,12 @@ # Change Log

# [12.2.0](https://github.com/egoist/poi/compare/@poi/plugin-typescript@12.1.0...@poi/plugin-typescript@12.2.0) (2019-03-23)
### Bug Fixes
- **plugin-typescript:** use absolute path for configFile, closes [#543](https://github.com/egoist/poi/issues/543) ([ad6e781](https://github.com/egoist/poi/commit/ad6e781))
### Features
- **plugin-typescript:** support babel, closes [#544](https://github.com/egoist/poi/issues/544) ([c515d30](https://github.com/egoist/poi/commit/c515d30))
# [12.1.0](https://github.com/egoist/poi/compare/@poi/plugin-typescript@12.0.1...@poi/plugin-typescript@12.1.0) (2019-03-21)

@@ -8,0 +18,0 @@

32

index.js

@@ -5,13 +5,19 @@ exports.name = 'typescript'

api,
{ lintOnSave = true, configFile = 'tsconfig.json', loaderOptions } = {}
{
lintOnSave = true,
configFile = 'tsconfig.json',
babel: useBabel,
loaderOptions
} = {}
) => {
configFile = api.resolveCwd(configFile)
api.hook('createWebpackChain', config => {
const test = config.module
.rule('js')
.get('test')
.filter(re => {
return !re.test('.ts') && !re.test('.tsx')
})
config.module.rule('js').test(test)
const jsRule = config.module.rule('js')
const test = jsRule.get('test').filter(re => {
return !re.test('.ts') && !re.test('.tsx')
})
jsRule.test(test)
const rule = config.module.rule('ts').test(/\.tsx?$/)

@@ -32,2 +38,11 @@

if (useBabel) {
const babelLoaderPath = jsRule.use('babel-loader').get('loader')
const babelLoaderOptions = jsRule.use('babel-loader').get('options')
rule
.use('babel-loader')
.loader(babelLoaderPath)
.options(babelLoaderOptions)
}
rule

@@ -57,2 +72,3 @@ .use('ts-loader')

vue: true,
tsconfig: configFile,
tslint:

@@ -59,0 +75,0 @@ lintOnSave &&

{
"name": "@poi/plugin-typescript",
"version": "12.1.0",
"version": "12.2.0",
"publishConfig": {

@@ -23,3 +23,3 @@ "access": "public"

},
"gitHead": "3363cf08fa9851848ff5ddcb93909506cac15382"
"gitHead": "c73535b7b9ed02a30d2998454d6b8a922c72b61d"
}

@@ -9,2 +9,4 @@ # @poi/plugin-typescript

It's possible to run Babel alongside TypeScript using the [babel](#babel) option. When used with Babel, it's recommended to set `compilerOptions.target` to `es2015` or later in `tsconfig.json` to delegate the rest to Babel for auto polyfill based on browser targets.
## Install

@@ -44,2 +46,9 @@

### babel
- Type: `boolean`
- Default: `false`
Use Babel after the TypeScript compiler.
### lintOnSave

@@ -50,3 +59,3 @@

Lint TS files with `ts-lint` at compile time when a `tslint.json` is found in your project
Lint TS files with `ts-lint` at compile time, note that it will only work when you have a `tslint.json` in your project root.

@@ -64,2 +73,2 @@ ### configFile

Addtional options for `ts-loader.
Addtional options for `ts-loader`.
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc