Rename some files to .cjs, make the codebase aware of .cjs and .mjs extensions

This commit is contained in:
Alex Gleason
2023-01-17 18:34:11 -06:00
parent 988d466fcd
commit 54eae01255
14 changed files with 17 additions and 10 deletions

View File

@ -12,7 +12,7 @@ const settings = {
test_root_path: `${FE_BUILD_DIR}-test`,
cache_path: 'tmp/cache',
resolved_paths: [],
extensions: [ '.mjs', '.js', '.jsx', '.ts', '.tsx', '.sass', '.scss', '.css', '.module.sass', '.module.scss', '.module.css', '.png', '.svg', '.gif', '.jpeg', '.jpg' ],
extensions: [ '.js', '.jsx', '.cjs', '.mjs', '.ts', '.tsx', '.sass', '.scss', '.css', '.module.sass', '.module.scss', '.module.css', '.png', '.svg', '.gif', '.jpeg', '.jpg' ],
};
const outputDir = env.NODE_ENV === 'test' ? settings.test_root_path : settings.public_root_path;

View File

@ -7,7 +7,7 @@ import type { RuleSetRule } from 'webpack';
const isDevelopment = process.env.NODE_ENV === 'development';
const rule: RuleSetRule = {
test: /\.(js|jsx|mjs|ts|tsx)$/,
test: /\.(js|jsx|cjs|mjs|ts|tsx)$/,
include: [
settings.source_path,
...settings.resolved_paths,