-
Notifications
You must be signed in to change notification settings - Fork 4
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
chore: UI Kit 빌드 세팅 완료 #2
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
module.exports = { | ||
parser: '@typescript-eslint/parser', | ||
parserOptions: { | ||
ecmaVersion: 2020, | ||
sourceType: 'module', | ||
ecmaFeatures: { | ||
jsx: true, | ||
}, | ||
}, | ||
settings: { | ||
react: { | ||
version: 'detect', | ||
}, | ||
}, | ||
extends: [ | ||
'plugin:react/recommended', | ||
'plugin:@typescript-eslint/recommended', | ||
'prettier/@typescript-eslint', | ||
'plugin:prettier/recommended', | ||
], | ||
rules: {}, | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
src | ||
example | ||
.storybook | ||
.github | ||
config | ||
tasks | ||
.vscode | ||
.idea |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
10.15.0 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
dist | ||
.github | ||
node_modules |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"printWidth": 100, | ||
"singleQuote": true, | ||
"trailingComma": "es5" | ||
} |
This file was deleted.
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
import path from 'path'; | ||
|
||
import autoprefixer from 'autoprefixer'; | ||
import commonjs from '@rollup/plugin-commonjs'; | ||
import resolve from '@rollup/plugin-node-resolve'; | ||
import postcss from 'rollup-plugin-postcss'; | ||
import typescript from 'rollup-plugin-typescript2'; | ||
// import babel from 'rollup-plugin-babel'; | ||
|
||
const extensions = ['.js', '.jsx', '.ts', '.tsx']; | ||
|
||
export default [ | ||
buildCJS('src/components/index.ts'), | ||
buildESM('src/components/index.ts'), | ||
buildCSS('src/components/index.scss', 'css/lubycon-ui-kit.css'), | ||
buildCSS('src/components/index.scss', 'css/lubycon-ui-kit.min.css', { | ||
minimize: { | ||
preset: ['default'], | ||
}, | ||
}), | ||
]; | ||
|
||
function buildJS(input, output, format) { | ||
return { | ||
input, | ||
external: ['react', 'react-dom'], | ||
output: [{ file: output, format, sourcemap: true }], | ||
plugins: [ | ||
typescript({ | ||
tsconfig: 'tsconfig.json', | ||
}), | ||
// babel({ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 바벨 설정은 TODO 인가요 ?? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 사실 요게 TDS 설정을 가져온 건데, 거기에는 바벨이 붙어있었거든용. 여기서는 굳이 필요없을 것 같기는 한데 TDS에서 바벨을 왜 붙힌건지 명확하게 파악이 안되어서 일단 주석으로만 처리해두었습니다. 도입 의도가 명확하게 파악되고 진짜 필요없다는 판단이 들면 제거하려고 합니다! |
||
// extensions, | ||
// runtimeHelpers: true, | ||
// include: ['src/**'], | ||
// }), | ||
resolve({ extensions }), | ||
commonjs({ | ||
namedExports: { | ||
'prop-types': ['node', 'bool', 'string', 'any', 'arrayOf', 'oneOfType', 'object', 'func'], | ||
}, | ||
}), | ||
], | ||
}; | ||
} | ||
|
||
function buildCJS(input) { | ||
const filename = path.parse(input).name; | ||
|
||
return buildJS(input, `dist/${filename}.js`, 'cjs'); | ||
} | ||
|
||
function buildESM(input) { | ||
const filename = path.parse(input).name; | ||
return buildJS(input, `dist/esm/${filename}.js`, 'es'); | ||
} | ||
|
||
function buildCSS(inputFile, outputFile, postCSSOptions = {}) { | ||
return { | ||
input: inputFile, | ||
output: { file: `dist/${outputFile}`, format: 'cjs' }, // format is not used. | ||
plugins: [ | ||
postcss({ | ||
plugins: [autoprefixer], | ||
sourceMap: true, | ||
extract: true, | ||
extensions: ['.scss', '.css'], | ||
...postCSSOptions, | ||
}), | ||
], | ||
}; | ||
} |
This file was deleted.
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import React, { HTMLAttributes } from 'react'; | ||
|
||
export default function Button(props: HTMLAttributes<HTMLButtonElement>): JSX.Element { | ||
return <button className="button" {...props} />; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.button { | ||
outline: 0; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
@import './Button/style.scss'; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { default as Button } from './Button'; |
This file was deleted.
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.
.vscode
폴더나.idea
폴더 들도 같이 ignore 시키면 좋을거 같아요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.
굿굿
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.
8581690 에서 추가되었습니다!