* change root dit and change way to import modules * update deps to latest versions * use latest tools for building bundles * rewrite webpack config * use nomodule technique for loading modern bundle * inject polyfills by babel usebuiltins * update eslint rules * rename all style files to CSS * use postcss preset env for building styles * proper typescript typing * put all html files to templates folder * etc
31 lines
892 B
JavaScript
31 lines
892 B
JavaScript
module.exports = {
|
|
transform: {
|
|
'^.+\\.tsx?$': 'ts-jest',
|
|
'^.+\\.jsx?$': 'babel-jest',
|
|
},
|
|
moduleDirectories: ['node_modules', 'app'],
|
|
moduleNameMapper: {
|
|
'\\.css': 'identity-obj-proxy',
|
|
'^react$': 'preact/compat',
|
|
'^react-dom$': 'preact/compat',
|
|
/**
|
|
* "transformIgnorePatterns" just don't work for modules down below
|
|
* If you know how to handle it better PR welcome
|
|
*/
|
|
'^@github/markdown-toolbar-element$': 'identity-obj-proxy',
|
|
'^@github/text-expander-element$': 'identity-obj-proxy',
|
|
},
|
|
setupFiles: ['<rootDir>/jest.setup.ts'],
|
|
setupFilesAfterEnv: [
|
|
'jest-localstorage-mock',
|
|
'<rootDir>/app/__mocks__/headers.ts',
|
|
'<rootDir>/app/__stubs__/static-config.ts',
|
|
],
|
|
collectCoverageFrom: ['!**/__mocks__/**', '!**/__stubs__/**', '!app/locales/**'],
|
|
globals: {
|
|
'ts-jest': {
|
|
babelConfig: true,
|
|
},
|
|
},
|
|
};
|