@atlascommunity/tsconfig-base
v1.1.3
Published
Base tsconfig
Downloads
119
Keywords
Readme
Atlas Community Base tsconfig
Installation
yarn add --dev @atlascommunity/tsconfig-baseIn tsconfig.json add row:
"extends": "@atlascommunity/tsconfig-base"Migration from v1.0.9 to v1.1.0
tsconfig.json
- Remove
moduleandnoEmitfields in your tsconfig
webpack.config.js
- Change the ts-loader to:
{
test: /\.(ts|tsx)$/,
use: [{
loader: 'ts-loader',
options: { compilerOptions: { noEmit: false } },
}],
exclude: /node_modules/,
},- Change the css-loader to:
// This will allow you to use regular css import in conjunction with modules
{
loader: 'css-loader',
options: {
esModule: true,
modules: {
namedExport: true,
auto: /\.module\.\w+$/i,
},
},
},- Add a field after
module
// This will prevent unnamed dependency imports
module: {
strictExportPresence: true,
// rules { ...
}- If you are using modules in your project, add this to your
.d.tsfile
declare module "*.module.css" {
const content: Record<string, string>;
export = content;
}
declare module "*.module.pcss" {
const content: Record<string, string>;
export = content;
}package.json
- If your
package.jsonuses thesideEffectsfield, remove it - Update your
typescriptto the latest version(^5.6.*)
New rules for using named module imports
Old import:
import styles from './file.module.css'New import:
import * as styles from './file.module.css'