Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
maier49 committed Sep 10, 2020
1 parent e8947a0 commit 8e60ee5
Show file tree
Hide file tree
Showing 7 changed files with 84 additions and 65 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"serve": "serve -p 9999",
"test:ci": "run-p --race serve test",
"test:cypress": "cypress run",
"test": "run-s build artifact:package artifact:install build artifact:build:* test:cypress",
"test": "run-s build artifact:package artifact:install artifact:build:* test:cypress",
"uploadCoverage": "codecov --file=coverage/coverage.json",
"watch:ts": "dojo-tsc-watcher -p tsconfig.json -- dojo-package",
"watch": "run-p watch:ts \"build:static:** -- --watch\""
Expand Down Expand Up @@ -151,7 +151,7 @@
"stylelint": "9.10.1",
"stylelint-webpack-plugin": "0.10.5",
"terser-webpack-plugin": "1.1.0",
"ts-loader": "5.3.0",
"ts-loader": "8.0.3",
"ts-node": "7.0.1",
"tsconfig-paths-webpack-plugin": "3.2.0",
"typed-css-modules": "0.3.1",
Expand Down
12 changes: 7 additions & 5 deletions src/base.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export const packageName = packageJson.name || '';

const esLintPath = path.join(basePath, '.eslintrc.json');
const esLint = existsSync(esLintPath) ? require(esLintPath) : false;
(process as any).traceDeprecation = true;
(process as any).noDeprecation = true;

function getEsLintExclusions() {
if (esLint && esLint.ignorePatterns) {
Expand Down Expand Up @@ -349,15 +349,17 @@ export default function webpackConfigFactory(args: any): webpack.Configuration {

if (!isExperimentalSpeed || isLegacy) {
postCssModuleLoader.push({
loader: 'postcss-loader?sourceMap',
loader: 'postcss-loader',
options: {
sourceMap: true,
ident: 'postcss',
plugins: [postcssImport(postcssImportConfig), postcssPresetEnv(postcssPresetConfig)]
}
});
cssLoader.push({
loader: 'postcss-loader?sourceMap',
loader: 'postcss-loader',
options: {
sourceMap: true,
ident: 'postcss',
plugins: [postcssImport(postcssImportConfig), postcssPresetEnv(postcssPresetConfig)]
}
Expand Down Expand Up @@ -416,7 +418,7 @@ export default function webpackConfigFactory(args: any): webpack.Configuration {
: {
cacheGroups: {
default: false,
vendors: false,
defaultVendors: false,
main: {
chunks: 'all',
minChunks: 1,
Expand Down Expand Up @@ -451,7 +453,7 @@ export default function webpackConfigFactory(args: any): webpack.Configuration {
}
}
},
devtool: 'source-map',
devtool: false,
watchOptions: { ignored: 'node_modules' },
plugins: removeEmpty([
new StyleLintPlugin({
Expand Down
6 changes: 5 additions & 1 deletion src/dist.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,13 @@ function webpackConfig(args: any): webpack.Configuration {
if (rule && typeof rule.loader === 'string' && rule.loader.startsWith('file-loader') && !rule.issuer) {
return {
...rule,
options: undefined,
loader: undefined,
use: [
rule.loader,
{
loader: rule.loader,
options: rule.options
},
{
loader: 'image-webpack-loader',
options: args.imageOptimization !== true ? args.imageOptimization : {}
Expand Down
6 changes: 5 additions & 1 deletion src/logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,11 @@ export default function logger(stats: any, config: any, runningMessage: string =
signOff = chalk.yellow('The build completed with warnings.');
warnings = `
${chalk.yellow('warnings:')}${chalk.gray(
stats.warnings.reduce((warnings: string, warning: string) => `${warnings}\n${stripAnsi(warning)}`, '')
stats.warnings.reduce(
(warnings: string, warning: string | { message?: string }) =>
`${warnings}\n${stripAnsi(typeof warning === 'string' ? warning : warning && warning.message)}`,
''
)
)}
`;
}
Expand Down
5 changes: 3 additions & 2 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -279,8 +279,9 @@ async function serve(config: webpack.Configuration, args: any) {
});
}

function warningsFilter(warning: string) {
return warning.includes('[mini-css-extract-plugin]\nConflicting order between');
function warningsFilter(warning: string | { message?: string }) {
const message = (typeof warning === 'string' ? warning : warning && warning.message) || '';
return message.includes('[mini-css-extract-plugin]\nConflicting order between');
}

const command: Command = {
Expand Down
110 changes: 59 additions & 51 deletions test-app/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions test-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@
"author": "",
"license": "ISC",
"dependencies": {
"@dojo/cli": "7.0.0-alpha.1",
"@dojo/framework": "7.0.0-alpha.16",
"@dojo/cli": "^7.0.0",
"@dojo/framework": "^7.0.2",
"@fortawesome/fontawesome-free": "5.3.1",
"tslib": "~1.9.1",
"cldr-data": "36.0.0",
"tslib": "~1.9.1",
"typescript": "~3.4.5"
},
"devDependencies": {
Expand Down

0 comments on commit 8e60ee5

Please sign in to comment.