CSS Loader _ Invalid options object ๋ฌธ์
์์ ์ผ๋ก ๊ณต๋ถ ์ค ์๋ฒ ์ฌ์ด๋ ํ๋ก๊ทธ๋๋ฐ(Server-side Programming) ํํธ์์ ๋ค์๊ณผ ๊ฐ์ ์๋ฌ๊ฐ ๋ฐ์ํ์๋ค.
ValidationError: Invalid options object. CSS Loader has been initialized using an options object that does not match the API schema. -options has an unknown property 'onlyLocals'.
๋ณธ ์๋ฌ๋ ์นํฉ์ผ๋ก ๋น๋๋ฅผ ์ด๋ค ๋ฐฉ์์ผ๋ก ์งํํ ์ง์ ๊ด๋ จ๋์ด, ์๋ฒ ์ ์ฉ ํ๊ฒฝ ์ค์ ์ ํด์ฃผ๋ webpack.config.server ์์ค ์ฝ๋ ์์์
๋ฐ์ํ ๋ฌธ์ ์ด๋ค.
CSS Loader ์ต์ ์ค์ ์ค onlyLocals๋ฅผ true๋ก ๋ช ์ํด์ฃผ๋ฉด ์ค์ CSSํ์ผ์ ์์ฑํ์ง ์๊ณ ์๋ณ์๋ก์์ ๊ธฐ๋ฅ๋ง ์ฃผ์ด์ง๋๋ฐ, ๋น๋๋ฅผ ํด๋ณด๋ฉด ํด๋น ์ต์ ์ด ์กด์ฌํ์ง ์๋ค๋ ์ค๋ฅ ๋ฉ์ธ์ง๊ฐ ๋ด๋ค.
webpack.js.org/loaders/css-loader/
css-loader | webpack
webpack is a module bundler. Its main purpose is to bundle JavaScript files for usage in a browser, yet it is also capable of transforming, bundling, or packaging just about any resource or asset.
webpack.js.org
์ด์ ๊ณต์ ๋ฌธ์๋ฅผ ์ฐธ์กฐํ์ฌ, ๊ด๋ จ ์ต์ ์ด onlyLocals๊ฐ ์๋ options ๋ด๋ถ์ modules ํ๋กํผํฐ๋ฅผ ์ฌ์ฉํ๊ณ ๋ด์ฅ ํ๋กํผํฐ๋ก exportOnlyLocals๋ฅผ true๋ก ๋ฐ๊พธ์๋๋ ๋ฌธ์ ์์ด ๋น๋๊ฐ ๋์๋ค.
๊ต์ฌ์ ๋ด์ฉ์ด ์๋ชป ๊ธฐ์ฌ๋์ด ์๋์ง ํ์ธํ๊ธฐ ์ํด ์ถ๊ฐ๋ก ๊ด๋ จ ๋ ํผ๋ฐ์ค๋ฅผ ์ฐพ์๋ณธ ๊ฒฐ๊ณผ, ์คํ๋ ค exportOnlyLocals ์ต์ ์ด onlyLocals ์ต์ ์ผ๋ก ๋ฐ๋์์์ ํ์ธํ ์ ์์๋ค.
github.com/webpack-contrib/css-loader/pull/957/files
feat: `exportOnlyLocals` was remove in favor new `onlyLocals` option by alexander-akait · Pull Request #957 · webpack-contrib/
This PR contains a: bugfix new feature code refactor test update typo fix metadata update Motivation / Use-Case Reduce name of option Breaking Changes Yes BREAKING CHANGE: rename exportOnl...
github.com
๋ฒ์ ์์ ๋ฌธ์ ๋ก ์ธํด ํ์ฌ ์ด๋ฌํ ๋ฌธ์ ๊ฐ ๋ฐ์ํ ๊ฒ ๊ฐ์๋ฐ ํฅํ ์ ํํ ์์ธ์ด ๋ฌด์์ธ์ง ํ์ธํ๊ฒ ๋๋ฉด ๊ด๋ จ ์ฌํญ์ ์ถ๊ฐํ๊ณ ์ ํ๋ค.