์ผ๋ฐ์ ์ธ ์ผํ์ฑ ๋น๋๋ ์ ์๋ํฉ๋๋ค. ๊ทธ๋ฌ๋ rollup -w
๋ฅผ ์ฌ์ฉํ ๋ ๋ค๋ฅธ ํจํค์ง ์ค ํ๋์์ ๋ ๊น์ ๋ชจ๋ ์ข
์์ฑ ์ค ํ๋๋ฅผ ํธ์งํ๋ฉด rpt2๊ฐ ์์ค ํ์ผ์ ์ฐพ๋ ๋ฐ ๋ฌธ์ ๊ฐ ์๋ ๊ฒ ๊ฐ์ต๋๋ค.
์ด๊ฒ์ Lerna monorepo๊ฐ โโ๋ฆฌํฌ์งํ ๋ฆฌ ๋ด ์ข ์์ฑ์ ๋ํ ์ฌ๋ณผ๋ฆญ ๋งํฌ๋ฅผ ์ค์ ํ๋ ๊ฒ์ ๋๋ค.
ํ ์คํธ ์ ์ฅ์: https://github.com/jrburke/jr-monorepo-rpt2
preserveSymlinks
๋ฅผ ์ฌ์ฉํ๊ณ ์ถ์ง ์์ต๋๋ค. ์๋ํ๋ฉด ์ค์ ํ๋ก์ ํธ์์๋ ๋ฆฌํฌ์งํ ๋ฆฌ์ ์ฌ๋ฌ ํจํค์ง๊ฐ ๊ณตํต ์ข
์์ฑ์ ๊ณต์ ํ๊ธฐ ๋๋ฌธ์ ์ต์ข
๋น๋ ํ๋ก์ ํธ์์ ๋ชจ๋์ด ์ค๋ณต๋๊ธฐ ๋๋ฌธ์
๋๋ค. preserveSymlinks
์ฌ์ฉํ์ฌ ๋ฒ์ ์ ์๋ํ์ผ๋ฉฐ ์ตํ์ ์๋จ์ผ๋ก preserveSymlinks
๋ฅผ ์ฌ์ฉํ๋ ๊ฐ๋ฐ ์ค์ ์ ๊ตฌ์ฑํ ์ ์์ง๋ง ๋
๋ฆฝ ์คํํ/์ต์ด ๋น๋๋ ๊ทธ๊ฒ ์์ด ์๋ํ๋ฉฐ ๊ณ์ ์ ์งํ๊ณ ์ถ์ต๋๋ค. ์๊ณ ์ค์ ์ ์ผ๋ฐ ๋น๋์ ๋์ผํฉ๋๋ค.
์์ ์์ ๋ฆฌํฌ์งํ ๋ฆฌ์์ ์ฌํํ ์ธ๋ถ์ ๋ณด์ ๋๋ค.
import commonjs from '@rollup/plugin-commonjs';
import resolve from '@rollup/plugin-node-resolve';
import typescript from 'rollup-plugin-typescript2';
export default {
input: 'src/index.ts',
output: {
file: 'dist/jr-player.js',
format: 'iife',
name: 'jrPlayer',
exports: 'named'
},
watch: {
include: ['src/**', '../jr-lib/src/**', '../jr-auth/src/**']
},
plugins: [
typescript({
include: ['src/**/*.ts+(|x)', '../jr-lib/**/*.ts+(|x)', '../jr-auth/**/*.ts+(|x)'],
verbosity: 3
}),
resolve(),
commonjs()
]
};
์ต์์ tsconfig.json:
{
"compilerOptions": {
"moduleResolution": "node",
"module": "es2015",
"lib": [
"es2015",
"es2016",
"es2017",
"dom"
],
"strict": true,
"sourceMap": true,
"declaration": true,
"allowSyntheticDefaultImports": true,
"downlevelIteration": true,
"experimentalDecorators": true,
"emitDecoratorMetadata": true,
"noImplicitAny": false,
"esModuleInterop": true,
"removeComments": true,
"resolveJsonModule": true,
"skipLibCheck": true
}
}
packages/jr-player/tsconfig.json
:
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"target": "es5",
"declarationDir": "lib",
"outDir": "lib"
},
"include": ["."]
}
๋๋ ๊ทธ๊ฒ์ด ๊ด๋ จ์ด ์๋ค๊ณ ์๊ฐํ์ง ์์ง๋ง ํ ์คํธ ์ ์ฅ์์ ์์ต๋๋ค.
์ฒจ๋ถ๋์์ง๋ง verbose-error.txt
ํ
์คํธ ๋ฆฌํฌ์งํ ๋ฆฌ์๋ ์์ต๋๋ค.
#188๊ณผ ๊ด๋ จ์ด ์์ ์ ์์ต๋๋ค.
๋ ๋ค๋ฅธ ํด๊ฒฐ ๋ฐฉ๋ฒ์ check: false
typechecking์ ๋นํ์ฑํํ๋ ๊ฒ์
๋๋ค. ๋ฌผ๋ก ๋๋ถ๋ถ์ ๊ธฐ๋ฅ์ด ์ ๊ฑฐ๋ฉ๋๋ค...
rollup-plugin-typescript2
๋ฐ rollup-plugin-postcss
๊ฒฐํฉํ๋ ๋ฐ ๋ฌธ์ ๊ฐ ์์ต๋๋ค. _css_ ํ์ผ(์: import * as style from ./mystyle.css
)์ ๊ฐ์ ธ์ค๊ณ _watch_ ํ๋๊ทธ๋ฅผ ํ์ฑํํ๋ฉด ๋์ผํ ์ค๋ฅ๊ฐ ๋ฐ์ํฉ๋๋ค.
๋๋ฒ๊ทธ๋ฅผ ์กฐ๊ธ ๋ ์๋ํ๊ฒ ์ง๋ง ์ค์ ๋ก check: false
๋ฌธ์ ๋ฅผ ํด๊ฒฐํฉ๋๋ค.