@lipemat/js-boilerplate 10.8.0-beta.5 → 10.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -130,6 +130,13 @@ module.exports = {
130
130
  use: [
131
131
  MiniCssExtractPlugin.loader,
132
132
  'css-loader',
133
+ {
134
+ loader: 'clean-css-loader',
135
+ options: {
136
+ level: 2,
137
+ sourceMap: false,
138
+ },
139
+ },
133
140
  ],
134
141
  },
135
142
  {
package/helpers/config.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import {existsSync} from 'fs';
2
2
  import {resolve} from 'path';
3
+ import webpack from 'webpack';
3
4
  import type {BabelConfig} from '../config/babel.config';
4
5
  import type {JestConfig} from '../config/jest.config';
5
6
  import {getPackageConfig} from './package-config';
@@ -13,6 +14,7 @@ type Configs = {
13
14
  'babel.config': BabelConfig;
14
15
  'jest.config': JestConfig;
15
16
  'entries.config': EntriesConfig;
17
+ 'webpack.dist': webpack.Configuration;
16
18
  };
17
19
 
18
20
  const {dependencies, devDependencies, workingDirectory, packageDirectory} = getPackageConfig();
@@ -8,7 +8,7 @@ const defaults = {
8
8
  brotliFiles: false,
9
9
  cssTsFiles: false,
10
10
  es6Modules: [],
11
- jsPath: '',
11
+ jsPath: './',
12
12
  packageDirectory: workingDirectory,
13
13
  shortCssClasses: false,
14
14
  url: 'http://localhost',
@@ -52,7 +52,7 @@ const defaults: Partial<PackageConfig> = {
52
52
  brotliFiles: false,
53
53
  cssTsFiles: false,
54
54
  es6Modules: [],
55
- jsPath: '',
55
+ jsPath: './',
56
56
  packageDirectory: workingDirectory,
57
57
  shortCssClasses: false,
58
58
  url: 'http://localhost',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lipemat/js-boilerplate",
3
- "version": "10.8.0-beta.5",
3
+ "version": "10.8.0",
4
4
  "description": "Dependencies and scripts for a no config JavaScript app",
5
5
  "author": "Mat Lipe",
6
6
  "license": "MIT",
@@ -23,6 +23,7 @@
23
23
  "no-config"
24
24
  ],
25
25
  "files": [
26
+ "tsconfig.json",
26
27
  "bin/",
27
28
  "config/",
28
29
  "helpers/",
@@ -37,6 +38,7 @@
37
38
  "build": "ts-node ./bin/build.ts",
38
39
  "prepublishOnly": "yarn run build",
39
40
  "test": "lipemat-js-boilerplate test",
41
+ "validate-ts": "tsc --noEmit",
40
42
  "watch": "ts-node ./bin/watch.ts"
41
43
  },
42
44
  "dependencies": {
@@ -61,6 +63,7 @@
61
63
  "browserslist": "^4.21.9",
62
64
  "chalk": "^4.0",
63
65
  "clean-css": "^5.3.0",
66
+ "clean-css-loader": "^4.2.1",
64
67
  "clean-webpack-plugin": "^4.0.0",
65
68
  "compression-webpack-plugin": "^10.0.0",
66
69
  "core-js": "^3.33.1",
@@ -19,7 +19,7 @@ Usage: lipemat-js-boilerplate analyze [--stats-only|--help]
19
19
  const flags = minimist( process.argv.slice( 2 ) );
20
20
  const workingDirectory = fs.realpathSync( process.cwd() );
21
21
  const statsDir = workingDirectory + '/node_modules/.cache/statoscope';
22
- const webpackConfig = getConfig<webpack.Configuration>( 'webpack.dist' );
22
+ const webpackConfig = getConfig( 'webpack.dist' );
23
23
 
24
24
  if ( true === flags.h || true === flags.help ) {
25
25
  console.log( help );
@@ -23,7 +23,7 @@ if ( '-h' === args[ 0 ] || '--help' === args[ 0 ] ) {
23
23
  }
24
24
 
25
25
  async function validate() {
26
- let webpackConfig = getConfig<webpack.Configuration>( 'webpack.dist' );
26
+ let webpackConfig = getConfig( 'webpack.dist' );
27
27
  webpackConfig.stats = 'errors-warnings';
28
28
 
29
29
  // Add CSS module typings generation to webpack config.
@@ -59,7 +59,7 @@ async function validate() {
59
59
  console.log( '>>> CSS Module definitions generated.' );
60
60
 
61
61
  // A fresh config for CSS validation.
62
- webpackConfig = getConfig( 'webpack.dist.js' );
62
+ webpackConfig = getConfig( 'webpack.dist' );
63
63
  webpackConfig.stats = 'errors-warnings';
64
64
  webpack( webpackConfig ).run( ( err, stats ) => {
65
65
  if ( err ) {
package/tsconfig.json ADDED
@@ -0,0 +1,18 @@
1
+ {
2
+ "extends": "./config/tsconfig.json",
3
+ "$schema": "https://json.schemastore.org/tsconfig",
4
+ "display": "JS Boilerplate",
5
+ "include": [
6
+ "bin/**/*",
7
+ "config/**/*",
8
+ "helpers/**/*",
9
+ "lib/**/*",
10
+ "jest/**/*",
11
+ "scripts/**/*",
12
+ "src/**/*"
13
+ ],
14
+ "compilerOptions": {
15
+ "esModuleInterop": true,
16
+ "module": "CommonJS"
17
+ }
18
+ }