Skip to content

Commit

Permalink
build: improve config
Browse files Browse the repository at this point in the history
  • Loading branch information
fengyuanchen committed Feb 7, 2022
1 parent 9b69fdf commit 451c1c9
Show file tree
Hide file tree
Showing 8 changed files with 37 additions and 9 deletions.
2 changes: 2 additions & 0 deletions .browserslistrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
defaults
not ie 11
5 changes: 5 additions & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module.exports = {
extends: [
'@commitlint/config-conventional',
],
};
4 changes: 4 additions & 0 deletions lint-staged.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module.exports = {
'*.{js,ts,vue}': 'eslint --fix',
'*.{css,scss,vue}': 'stylelint --fix',
};
1 change: 0 additions & 1 deletion postcss.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
module.exports = {
plugins: {
autoprefixer: {},
stylelint: {
fix: true,
},
Expand Down
15 changes: 13 additions & 2 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const banner = createBanner({
});

export default ['umd', 'esm'].map((format) => ({
input: 'src/index.ts',
input: 'src/vue-feather.vue',
output: ['development', 'production'].map((mode) => {
const output = {
banner,
Expand Down Expand Up @@ -44,7 +44,18 @@ export default ['umd', 'esm'].map((format) => ({
}),
external: Object.keys(pkg.peerDependencies),
plugins: [
typescript(),
typescript({
tsconfigOverride: {
compilerOptions: {
declaration: format === 'esm',
},
exclude: [
'src/index.ts',
'docs',
'tests',
],
},
}),
vue({
preprocessStyles: true,
}),
Expand Down
5 changes: 1 addition & 4 deletions stylelint.config.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
module.exports = {
extends: [
'stylelint-config-standard',
'stylelint-config-recommended-scss',
],
extends: 'stylelint-config-recommended-vue/scss',
plugins: [
'stylelint-order',
],
Expand Down
8 changes: 7 additions & 1 deletion tsconfig.eslint.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
{
"extends": "./tsconfig",
"include": ["*.js", ".*.js", "docs", "src", "tests", "types"]
"include": [
"*.js",
".*.js",
"docs/**/*",
"src/**/*",
"tests/**/*"
]
}
6 changes: 5 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,9 @@
"strict": true,
"target": "esnext",
},
"include": ["docs", "src", "types"]
"include": [
"src/**/*",
"docs/**/*",
"tests/**/*"
]
}

0 comments on commit 451c1c9

Please sign in to comment.