shakapacker 9.0.0 → 9.1.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.
data/package/swc/index.ts CHANGED
@@ -9,9 +9,11 @@ import type { RuleSetRule } from "webpack"
9
9
  const JSX_FILE_REGEX = /\.(jsx|tsx)(\.erb)?$/
10
10
  const TYPESCRIPT_FILE_REGEX = /\.(ts|tsx)(\.erb)?$/
11
11
 
12
- const isJsxFile = (filename: string): boolean => !!filename.match(JSX_FILE_REGEX)
12
+ const isJsxFile = (filename: string): boolean =>
13
+ !!filename.match(JSX_FILE_REGEX)
13
14
 
14
- const isTypescriptFile = (filename: string): boolean => !!filename.match(TYPESCRIPT_FILE_REGEX)
15
+ const isTypescriptFile = (filename: string): boolean =>
16
+ !!filename.match(TYPESCRIPT_FILE_REGEX)
15
17
 
16
18
  const getCustomConfig = (): Partial<RuleSetRule> => {
17
19
  const path = resolve("config", "swc.config.js")
@@ -37,7 +39,7 @@ const getSwcLoaderConfig = (filenameToProcess: string): RuleSetRule => {
37
39
  syntax: isTs ? "typescript" : "ecmascript",
38
40
  [jsxKey]: isJsx
39
41
  },
40
- loose: true
42
+ loose: false
41
43
  },
42
44
  sourceMaps: true,
43
45
  env: {
@@ -41,7 +41,8 @@ import type {
41
41
  ### Webpack/Rspack Types
42
42
  - `WebpackConfigWithDevServer` - Webpack config with dev server
43
43
  - `RspackConfigWithDevServer` - Rspack config with dev server
44
- - `RspackPlugin` - Rspack plugin interface
44
+ - `RspackPluginInstance` - Rspack plugin instance type
45
+ - `RspackPlugin` - **⚠️ Deprecated:** Use `RspackPluginInstance` instead
45
46
  - `RspackDevServerConfig` - Rspack dev server configuration
46
47
  - `CompressionPluginOptions` - Options for compression plugin
47
48
  - `CompressionPluginConstructor` - Constructor type for compression plugin
@@ -40,6 +40,7 @@ export type {
40
40
  // Environment configuration types
41
41
  export type {
42
42
  WebpackConfigWithDevServer,
43
+ RspackPluginInstance,
43
44
  RspackPlugin,
44
45
  RspackDevServerConfig,
45
46
  RspackConfigWithDevServer,
@@ -16,24 +16,24 @@ const isDebugMode = (): boolean => {
16
16
  )
17
17
  }
18
18
 
19
- const debug = (message: string, ...args: any[]): void => {
19
+ const debug = (message: string, ...args: unknown[]): void => {
20
20
  if (isDebugMode()) {
21
21
  // eslint-disable-next-line no-console
22
22
  console.log(`[Shakapacker] ${message}`, ...args)
23
23
  }
24
24
  }
25
25
 
26
- const warn = (message: string, ...args: any[]): void => {
26
+ const warn = (message: string, ...args: unknown[]): void => {
27
27
  // eslint-disable-next-line no-console
28
28
  console.warn(`[Shakapacker] WARNING: ${message}`, ...args)
29
29
  }
30
30
 
31
- const error = (message: string, ...args: any[]): void => {
31
+ const error = (message: string, ...args: unknown[]): void => {
32
32
  // eslint-disable-next-line no-console
33
33
  console.error(`[Shakapacker] ERROR: ${message}`, ...args)
34
34
  }
35
35
 
36
- const info = (message: string, ...args: any[]): void => {
36
+ const info = (message: string, ...args: unknown[]): void => {
37
37
  if (isDebugMode()) {
38
38
  // eslint-disable-next-line no-console
39
39
  console.info(`[Shakapacker] INFO: ${message}`, ...args)
@@ -46,4 +46,4 @@ export = {
46
46
  error,
47
47
  info,
48
48
  isDebugMode
49
- }
49
+ }