-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
dpyzo0o
committed
Dec 16, 2019
0 parents
commit a9cfe24
Showing
33 changed files
with
17,062 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# http://editorconfig.org | ||
root = true | ||
|
||
[*] | ||
indent_style = space | ||
indent_size = 2 | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
|
||
[*.md] | ||
trim_trailing_whitespace = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"extends": ["taro"], | ||
"rules": { | ||
"@typescript-eslint/no-unused-vars": ["error", { "varsIgnorePattern": "Taro" }], | ||
"no-unused-vars": ["off"], | ||
"react/jsx-filename-extension": [1, { "extensions": [".js", ".jsx", ".tsx"] }], | ||
"react/sort-comp": 0 | ||
}, | ||
"parser": "@typescript-eslint/parser", | ||
"plugins": ["@typescript-eslint"], | ||
"parserOptions": { | ||
"ecmaFeatures": { | ||
"jsx": true | ||
}, | ||
"useJSXTextNode": true, | ||
"project": "./tsconfig.json" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
dist/ | ||
deploy_versions/ | ||
.temp/ | ||
.rn_temp/ | ||
node_modules/ | ||
.DS_Store | ||
|
||
# IDE - VSCode | ||
.vscode/* | ||
!.vscode/settings.json | ||
!.vscode/tasks.json | ||
!.vscode/launch.json | ||
!.vscode/extensions.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"singleQuote": true, | ||
"jsxSingleQuote": true, | ||
"printWidth": 100, | ||
"trailingComma": "es5" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"editor.formatOnSave": true, | ||
"eslint.validate": [ | ||
{ "language": "typescript", "autoFix": true }, | ||
{ "language": "typescriptreact", "autoFix": true } | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
## Taro-Toolkit | ||
|
||
Taro + Redux + Typescript 快速开发模版 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
module.exports = { extends: ['@commitlint/config-conventional'] }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
module.exports = { | ||
env: { | ||
NODE_ENV: '"development"', | ||
}, | ||
defineConstants: {}, | ||
weapp: {}, | ||
h5: {}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,114 @@ | ||
const path = require('path'); | ||
|
||
// NOTE 在 sass 中通过别名(@ 或 ~)引用需要指定路径 | ||
const sassImporter = function(url) { | ||
if (url[0] === '~' && url[1] !== '/') { | ||
return { | ||
file: path.resolve(__dirname, '..', 'node_modules', url.substr(1)), | ||
}; | ||
} | ||
|
||
const reg = /^@styles\/(.*)/; | ||
return { | ||
file: reg.test(url) ? path.resolve(__dirname, '..', 'src/styles', url.match(reg)[1]) : url, | ||
}; | ||
}; | ||
|
||
const config = { | ||
projectName: 'with-redux-toolkit', | ||
date: '2019-12-5', | ||
designWidth: 750, | ||
deviceRatio: { | ||
'640': 2.34 / 2, | ||
'750': 1, | ||
'828': 1.81 / 2, | ||
}, | ||
sourceRoot: 'src', | ||
outputRoot: 'dist', | ||
plugins: { | ||
babel: { | ||
sourceMap: true, | ||
presets: [ | ||
[ | ||
'env', | ||
{ | ||
modules: false, | ||
}, | ||
], | ||
], | ||
plugins: [ | ||
'transform-decorators-legacy', | ||
'transform-class-properties', | ||
'transform-object-rest-spread', | ||
], | ||
}, | ||
sass: { | ||
importer: sassImporter, | ||
}, | ||
}, | ||
defineConstants: {}, | ||
alias: { | ||
'~': path.resolve(__dirname, '..', 'src'), | ||
}, | ||
copy: { | ||
patterns: [], | ||
options: {}, | ||
}, | ||
weapp: { | ||
module: { | ||
postcss: { | ||
autoprefixer: { | ||
enable: true, | ||
config: { | ||
browsers: ['last 3 versions', 'Android >= 4.1', 'ios >= 8'], | ||
}, | ||
}, | ||
pxtransform: { | ||
enable: true, | ||
config: {}, | ||
}, | ||
url: { | ||
enable: true, | ||
config: { | ||
limit: 10240, // 设定转换尺寸上限 | ||
}, | ||
}, | ||
cssModules: { | ||
enable: false, // 默认为 false,如需使用 css modules 功能,则设为 true | ||
config: { | ||
namingPattern: 'module', // 转换模式,取值为 global/module | ||
generateScopedName: '[name]__[local]___[hash:base64:5]', | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
h5: { | ||
publicPath: '/', | ||
staticDirectory: 'static', | ||
module: { | ||
postcss: { | ||
autoprefixer: { | ||
enable: true, | ||
config: { | ||
browsers: ['last 3 versions', 'Android >= 4.1', 'ios >= 8'], | ||
}, | ||
}, | ||
cssModules: { | ||
enable: false, // 默认为 false,如需使用 css modules 功能,则设为 true | ||
config: { | ||
namingPattern: 'module', // 转换模式,取值为 global/module | ||
generateScopedName: '[name]__[local]___[hash:base64:5]', | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}; | ||
|
||
module.exports = function(merge) { | ||
if (process.env.NODE_ENV === 'development') { | ||
return merge({}, config, require('./dev')); | ||
} | ||
return merge({}, config, require('./prod')); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
module.exports = { | ||
env: { | ||
NODE_ENV: '"production"', | ||
}, | ||
defineConstants: {}, | ||
weapp: {}, | ||
h5: { | ||
/** | ||
* 如果h5端编译后体积过大,可以使用webpack-bundle-analyzer插件对打包体积进行分析。 | ||
* 参考代码如下: | ||
* webpackChain (chain) { | ||
* chain.plugin('analyzer') | ||
* .use(require('webpack-bundle-analyzer').BundleAnalyzerPlugin, []) | ||
* } | ||
*/ | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
declare module "*.png"; | ||
declare module "*.gif"; | ||
declare module "*.jpg"; | ||
declare module "*.jpeg"; | ||
declare module "*.svg"; | ||
declare module "*.css"; | ||
declare module "*.less"; | ||
declare module "*.scss"; | ||
declare module "*.sass"; | ||
declare module "*.styl"; | ||
|
||
// @ts-ignore | ||
declare const process: { | ||
env: { | ||
TARO_ENV: 'weapp' | 'swan' | 'alipay' | 'h5' | 'rn' | 'tt' | 'quickapp' | 'qq'; | ||
[key: string]: any; | ||
} | ||
} |
Oops, something went wrong.