@razerspine/webpack-core 1.0.4 → 1.0.6

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.
@@ -4,10 +4,10 @@ export declare function createBaseConfig(options: ConfigOptionType): {
4
4
  mode: ModeType;
5
5
  /**
6
6
  * IMPORTANT:
7
- * Explicit empty entry to prevent webpack default './src'
8
- * PugPlugin controls entry points
7
+ * Disable default webpack entry (./src)
8
+ * because entry is fully controlled by pug-plugin
9
9
  */
10
- entry: {};
10
+ entry: () => {};
11
11
  output: {
12
12
  clean: boolean;
13
13
  };
@@ -12,10 +12,10 @@ function createBaseConfig(options) {
12
12
  mode,
13
13
  /**
14
14
  * IMPORTANT:
15
- * Explicit empty entry to prevent webpack default './src'
16
- * PugPlugin controls entry points
15
+ * Disable default webpack entry (./src)
16
+ * because entry is fully controlled by pug-plugin
17
17
  */
18
- entry: {},
18
+ entry: () => ({}),
19
19
  output: {
20
20
  clean: true,
21
21
  },
@@ -1,9 +1,2 @@
1
- export declare function createProdConfig(): {
2
- devtool: boolean;
3
- optimization: {
4
- minimize: boolean;
5
- splitChunks: {
6
- chunks: string;
7
- };
8
- };
9
- };
1
+ import type { Configuration } from 'webpack';
2
+ export declare function createProdConfig(baseConfig: Configuration): Configuration;
@@ -1,14 +1,19 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.createProdConfig = createProdConfig;
4
- function createProdConfig() {
4
+ function createProdConfig(baseConfig) {
5
5
  return {
6
+ ...baseConfig,
7
+ /**
8
+ * Prevent webpack from injecting ./src in production
9
+ */
10
+ entry: () => ({}),
6
11
  devtool: false,
7
12
  optimization: {
8
13
  minimize: true,
9
14
  splitChunks: {
10
- chunks: 'all'
11
- }
12
- }
15
+ chunks: 'all',
16
+ },
17
+ },
13
18
  };
14
19
  }
@@ -10,6 +10,7 @@ function templatesLoader(options) {
10
10
  return [
11
11
  new pug_plugin_1.default({
12
12
  entry: (_a = options.entry) !== null && _a !== void 0 ? _a : 'src/views/pages',
13
+ baseDir: process.cwd(),
13
14
  filename: ({ chunk }) => {
14
15
  let [name] = chunk.name.split('/');
15
16
  if (name === 'home')
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@razerspine/webpack-core",
3
- "version": "1.0.4",
3
+ "version": "1.0.6",
4
4
  "description": "Core webpack config and loaders for starter templates",
5
5
  "license": "ISC",
6
6
  "author": "Razerspine",
@@ -15,14 +15,15 @@
15
15
  "prepublishOnly": "npm run build"
16
16
  },
17
17
  "peerDependencies": {
18
- "webpack": "^5"
19
- },
20
- "dependencies": {
21
- "pug-plugin": "^5.0.3"
18
+ "webpack": "^5",
19
+ "webpack-dev-server": "^5",
20
+ "pug-plugin": "^5"
22
21
  },
23
22
  "devDependencies": {
24
23
  "@types/node": "^20.11.0",
25
24
  "typescript": "^5.3.3",
26
- "webpack-dev-server": "^5.2.3"
25
+ "webpack": "^5.105.0",
26
+ "webpack-dev-server": "^5.2.3",
27
+ "pug-plugin": "^5.0.3"
27
28
  }
28
29
  }