Skip to content

Commit

Permalink
feat: 初始化项目
Browse files Browse the repository at this point in the history
  • Loading branch information
申远 committed Aug 26, 2021
1 parent b4d5a95 commit f512150
Show file tree
Hide file tree
Showing 8 changed files with 1,614 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# EditorConfig is awesome: https://EditorConfig.org

# top-most EditorConfig file
root = true

[*]
indent_style = tab
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
7 changes: 7 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"recommendations": [
"editorconfig.editorconfig",
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode"
]
}
16 changes: 16 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"files.eol": "\n",
"editor.tabSize": 2,
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"eslint.validate": [
"javascript",
"javascriptreact",
"vue",
"typescript",
"typescriptreact"
],
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
}
}
20 changes: 20 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"name": "lib-start",
"version": "1.0.0",
"main": "dist/bundle.es5.js",
"module": "dist/bundle.esm.js",
"license": "MIT",
"scripts": {
"build": "npx rollup -c rollup.config.js"
},
"dependencies": {},
"devDependencies": {
"@babel/core": "^7.15.0",
"@babel/preset-env": "^7.15.0",
"@rollup/plugin-babel": "^5.3.0",
"@rollup/plugin-commonjs": "^20.0.0",
"@rollup/plugin-node-resolve": "^13.0.4",
"rollup": "^2.56.2",
"rollup-plugin-terser": "^7.0.2"
}
}
25 changes: 25 additions & 0 deletions rollup.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { getBabelOutputPlugin } from '@rollup/plugin-babel';
import commonjs from '@rollup/plugin-commonjs';
import { terser } from 'rollup-plugin-terser';

const config = {
input:'src/main.js',
output:[
{ file: 'dist/bundle.js', format: 'esm' },
{
file: 'dist/bundle.es5.js',
format: 'umd',
name:'$router',
plugins: [getBabelOutputPlugin({
presets: [['@babel/preset-env']],
allowAllFormats : true
})]
}
],
plugins: [
commonjs(),
terser()
],
};

export default config
1 change: 1 addition & 0 deletions src/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from "./router";
12 changes: 12 additions & 0 deletions src/router.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
export class Test{
a = 0;
constructor(a){
this.a = a
}
getA(){
return `a:${this.a}`
}
setA(a){
this.a = a
}
}
1,521 changes: 1,521 additions & 0 deletions yarn.lock

Large diffs are not rendered by default.

0 comments on commit f512150

Please sign in to comment.