-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
script 命令优化 #34
Open
MuYunyun
wants to merge
16
commits into
ming-cult:master
Choose a base branch
from
MuYunyun:feature/build
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
script 命令优化 #34
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
0a8815f
feat: temp
MuYunyun 7590e72
Merge remote-tracking branch 'remote/master'
MuYunyun 0ac0403
feat: markdown 中可以展示组件
MuYunyun e8a187c
feat: snake-design 样式添加
MuYunyun 30e942c
Merge remote-tracking branch 'remote/master'
MuYunyun d710669
fix: fix #14 fix #13
MuYunyun 51c8607
Merge remote-tracking branch 'remote/master'
MuYunyun 725bb11
Merge remote-tracking branch 'remote/master'
MuYunyun ac387ac
Merge remote-tracking branch 'remote/master'
MuYunyun 9046d4b
Merge remote-tracking branch 'remote/master'
MuYunyun 68cdc1a
feat: build
MuYunyun 2b32d6d
chore: start with bisheng
MuYunyun 60e25b3
feat: build
MuYunyun 69f2378
Merge branch 'master' into feature/build
anyexinglu 2b4cd05
Update package.json
anyexinglu 49233d3
feat: script 优化
MuYunyun File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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 |
---|---|---|
@@ -1,16 +1,16 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>组件库 based hooks</title> | ||
<!--忽略电话号码和 email 识别--> | ||
<meta name="format-detection" content="telephone=no" /> | ||
<meta name="format-detection" content="email=no" /> | ||
<meta name="viewport" content="width=device-width,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no,minimal-ui"> | ||
<link rel="shortcut icon" href="/favicon.ico"> | ||
<script src="/build/vendor/vendor.dll.js"></script> | ||
<meta charset="utf-8" /> | ||
<title>snake design</title> | ||
<meta | ||
name="viewport" | ||
content="width=device-width,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no,minimal-ui" | ||
/> | ||
<link rel="shortcut icon" href="/favicon.ico" /> | ||
</head> | ||
|
||
<body> | ||
<div id="app"></div> | ||
<div id="app"></div> | ||
</body> | ||
</html> |
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
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 |
---|---|---|
@@ -1,9 +1,24 @@ | ||
var ghpages = require('gh-pages'); | ||
var fs = require('fs') | ||
var path = require('path') | ||
var ghpages = require('gh-pages') | ||
|
||
ghpages.publish('docsDist', { | ||
repo: '[email protected]:ming-cult/snake-design.git' | ||
}, (err) => { | ||
if (err) { | ||
console.log(err) | ||
/* 将 main-65f5c183.css 转为 ./main-65f5c183.css */ | ||
const docsHtmlRoot = path.resolve(__dirname, '../docsDist/index.html') | ||
|
||
fs.readFile(docsHtmlRoot, (err, data) => { | ||
const htmlContent = data.toString().replace(/\/main/g, './main') | ||
fs.writeFile(docsHtmlRoot, htmlContent, () => {}) | ||
}) | ||
|
||
/* 发布 */ | ||
ghpages.publish( | ||
'docsDist', | ||
{ | ||
repo: '[email protected]:ming-cult/snake-design.git' | ||
}, | ||
err => { | ||
if (err) { | ||
console.log(err) | ||
} | ||
} | ||
}); | ||
) |
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,149 @@ | ||
const path = require('path') | ||
const CSSSplitWebpackPlugin = require('css-split-webpack-plugin').default | ||
// const replaceLib = require('antd-tools/lib/replaceLib') | ||
const HtmlWebpackPlugin = require('html-webpack-plugin') | ||
|
||
const isDev = process.env.NODE_ENV === 'development' | ||
const usePreact = process.env.REACT_ENV === 'preact' | ||
|
||
function alertBabelConfig(rules) { | ||
rules.forEach(rule => { | ||
if (rule.loader && rule.loader === 'babel-loader') { | ||
// if (rule.options.plugins.indexOf(replaceLib) === -1) { | ||
// rule.options.plugins.push(replaceLib) | ||
// } | ||
// eslint-disable-next-line | ||
rule.options.plugins = rule.options.plugins.filter( | ||
plugin => !plugin.indexOf || plugin.indexOf('babel-plugin-add-module-exports') === -1 | ||
) | ||
// Add babel-plugin-add-react-displayname | ||
rule.options.plugins.push(require.resolve('babel-plugin-add-react-displayname')) | ||
} else if (rule.use) { | ||
alertBabelConfig(rule.use) | ||
} | ||
}) | ||
} | ||
|
||
module.exports = { | ||
port: 8001, | ||
hash: true, | ||
// output: path.resolve(__dirname, '../docsDist'), | ||
output: path.resolve(__dirname, '../docsDist'), | ||
// source: { | ||
// components: './components', | ||
// docs: './docs', | ||
// changelog: ['CHANGELOG.zh-CN.md', 'CHANGELOG.en-US.md'], | ||
// }, | ||
// theme: './site/theme', | ||
// htmlTemplate: './site/theme/static/template.html', | ||
// htmlTemplate: '../docsDist/index.html', | ||
// htmlTemplate: path.resolve(__dirname, './index.html'), | ||
// themeConfig: { | ||
// categoryOrder: { | ||
// 'Ant Design': 0, | ||
// 原则: 1, | ||
// Principles: 1, | ||
// 视觉: 2, | ||
// Visual: 2, | ||
// 模式: 3, | ||
// Patterns: 3, | ||
// 其他: 6, | ||
// Other: 6, | ||
// Components: 100, | ||
// }, | ||
// typeOrder: { | ||
// General: 0, | ||
// Layout: 1, | ||
// Navigation: 2, | ||
// 'Data Entry': 3, | ||
// 'Data Display': 4, | ||
// Feedback: 5, | ||
// Other: 6, | ||
// 通用: 0, | ||
// 布局: 1, | ||
// 导航: 2, | ||
// 数据录入: 3, | ||
// 数据展示: 4, | ||
// 反馈: 5, | ||
// 其他: 6, | ||
// }, | ||
// docVersions: { | ||
// '0.9.x': 'http://09x.ant.design', | ||
// '0.10.x': 'http://010x.ant.design', | ||
// '0.11.x': 'http://011x.ant.design', | ||
// '0.12.x': 'http://012x.ant.design', | ||
// '1.x': 'http://1x.ant.design', | ||
// '2.x': 'http://2x.ant.design', | ||
// }, | ||
// }, | ||
filePathMapper(filePath) { | ||
// if (filePath === '/index.html') { | ||
// return ['/index.html', '/index-cn.html'] | ||
// } | ||
// if (filePath.endsWith('/index.html')) { | ||
// return [filePath, filePath.replace(/\/index\.html$/, '-cn/index.html')] | ||
// } | ||
// if (filePath !== '/404.html' && filePath !== '/index-cn.html') { | ||
// return [filePath, filePath.replace(/\.html$/, '-cn.html')] | ||
// } | ||
return filePath | ||
}, | ||
doraConfig: { | ||
verbose: true | ||
}, | ||
// lessConfig: { | ||
// javascriptEnabled: true | ||
// }, | ||
webpackConfig(config) { | ||
config.entry = { | ||
main: ['./docs/app.tsx'] | ||
} | ||
// config.output = { | ||
// path: path.resolve(__dirname, '../build'), | ||
// filename: '[name].js', | ||
// publicPath: '/' | ||
// } | ||
// eslint-disable-next-line | ||
config.resolve.alias = { | ||
components: path.join(process.cwd(), 'components'), | ||
types: path.join(process.cwd(), 'types'), | ||
layout: path.join(process.cwd(), 'docs/layout'), | ||
routes: path.join(process.cwd(), 'docs/routes'), | ||
static: path.join(process.cwd(), 'docs/static') | ||
} | ||
|
||
// eslint-disable-next-line | ||
// config.externals = { | ||
// 'react-router-dom': 'ReactRouterDOM' | ||
// } | ||
|
||
if (isDev) { | ||
// eslint-disable-next-line | ||
config.devtool = 'source-map' | ||
} | ||
|
||
alertBabelConfig(config.module.rules) | ||
|
||
config.plugins.push( | ||
new HtmlWebpackPlugin({ | ||
filename: 'index.html', | ||
template: path.resolve(__dirname, '../docs/index.html'), | ||
inject: true, | ||
chunks: ['vendor', 'main'] | ||
}) | ||
) | ||
config.plugins.push(new CSSSplitWebpackPlugin({ size: 4000 })) | ||
|
||
return config | ||
}, | ||
|
||
devServerConfig: { | ||
public: process.env.DEV_HOST || 'localhost', | ||
disableHostCheck: !!process.env.DEV_HOST | ||
}, | ||
|
||
htmlTemplateExtraData: { | ||
isDev, | ||
usePreact | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@anyexinglu 这里的 bisheng 来自 pipixia 这个包~
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
soga