Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Sep 27, 2024. It is now read-only.
/indoqa-webpackPublic archive

Commitb0a4f36

Browse files
committed
optionally support awesome-typescript-loader
1 parenta140ff8 commitb0a4f36

File tree

3 files changed

+19
-3
lines changed

3 files changed

+19
-3
lines changed

‎src/config/plugins.js‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ const webpack = require('webpack')
33
constHtmlWebpackPlugin=require('html-webpack-plugin')
44
constManifestPlugin=require('webpack-manifest-plugin')
55
constMiniCssExtractPlugin=require('mini-css-extract-plugin')
6-
constForkTsCheckerWebpackPlugin=require('fork-ts-checker-webpack-plugin');
6+
constForkTsCheckerWebpackPlugin=require('fork-ts-checker-webpack-plugin')
77

88
constcreatePlugins=(options,isDevelopment,isLibrary)=>{
99
constdefinePlugin=newwebpack.DefinePlugin({
@@ -75,7 +75,7 @@ const createPlugins = (options, isDevelopment, isLibrary) => {
7575
ignoreMomentJsLocaleResourcesPlugin,
7676
]
7777

78-
if(options.isTypescript){
78+
if(options.isTypescript&&options.tsDevTypeChecking){
7979
constforkTsChecker=newForkTsCheckerWebpackPlugin({
8080
async:false,
8181
watch:options.srcPath,

‎src/config/rules.js‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,19 @@ const createJavascriptRule = (isDevelopment) => {
4949
}
5050

5151
constcreateTypescriptRule=(options)=>{
52+
if(options.tsAwesomeTypescriptLoader){
53+
return{
54+
test:/\.tsx?$/,
55+
exclude:/node_modules/,
56+
use:{
57+
loader:'awesome-typescript-loader',
58+
options:{
59+
transpileOnly:true,
60+
useCache:true,
61+
},
62+
},
63+
}
64+
}
5265
return{
5366
test:/\.tsx?$/,
5467
exclude:/node_modules/,

‎src/createOptions.js‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ const DEFAULT_OPTIONS = {
1717
createIndexHtml:true,
1818
autoprefixerBrowser:['>1%','last 4 versions','Firefox ESR','not ie < 11'],
1919

20+
tsDevTypeChecking:false,
21+
tsAwesomeTypescriptLoader:false,
22+
2023
isLibrary:false,
2124
outputLibraryPath:'./dist/',
2225
}
@@ -37,7 +40,7 @@ const validate = options => {
3740
if(options.hasOwnProperty('mainJs')){
3841
console.log(chalk.red('The property mainJs was replaced by entry. Please change it.'))
3942
}
40-
43+
4144
if(options.hasOwnProperty('playgroundJs')){
4245
console.log(chalk.red('The property playgroundJs was replaced by playgroundEntry. Please change it.'))
4346
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp