From f3b52978f72febdcffd29c6cb579cf3461bc9459 Mon Sep 17 00:00:00 2001 From: atanasster Date: Sat, 2 Jan 2021 22:05:11 -0600 Subject: [PATCH] fix: md files to use raw-loader --- core/webpack-configs/src/instrument/index.ts | 4 ++-- .../src/react-docgen-typescript/index.ts | 4 ++-- core/webpack-configs/src/react-docgen/index.ts | 2 +- core/webpack-configs/src/react/index.ts | 16 ++++++++++++---- 4 files changed, 17 insertions(+), 9 deletions(-) diff --git a/core/webpack-configs/src/instrument/index.ts b/core/webpack-configs/src/instrument/index.ts index bef66c935..d022ef464 100644 --- a/core/webpack-configs/src/instrument/index.ts +++ b/core/webpack-configs/src/instrument/index.ts @@ -15,7 +15,7 @@ export const instrument: Configuration = { ], }, { - test: /\.(md|mdx)$/, + test: /\.mdx$/i, exclude: [/node_modules/], loader: 'babel-loader', options: { @@ -26,7 +26,7 @@ export const instrument: Configuration = { }, }, { - test: /\.(md|mdx)$/, + test: /\.mdx$/i, exclude: [/node_modules/], loader: '@component-controls/loader/loader', enforce: 'pre', diff --git a/core/webpack-configs/src/react-docgen-typescript/index.ts b/core/webpack-configs/src/react-docgen-typescript/index.ts index bfb012041..9d936a539 100644 --- a/core/webpack-configs/src/react-docgen-typescript/index.ts +++ b/core/webpack-configs/src/react-docgen-typescript/index.ts @@ -4,7 +4,7 @@ export const reactDocgenTypescript: Configuration = { module: { rules: [ { - test: /\.(md|mdx)$/, + test: /\.mdx$/i, exclude: [/node_modules/], loader: '@component-controls/loader/loader', enforce: 'pre', @@ -23,7 +23,7 @@ export const reactDocgenTypescript: Configuration = { }, { - test: /\.(story|stories).(js|jsx|ts|tsx|mdx)$/, + test: /\.(story|stories).(js|jsx|ts|tsx|mdx)$/i, loader: '@component-controls/loader/loader', exclude: [/node_modules/], enforce: 'pre', diff --git a/core/webpack-configs/src/react-docgen/index.ts b/core/webpack-configs/src/react-docgen/index.ts index 50e55fd58..a2440a144 100644 --- a/core/webpack-configs/src/react-docgen/index.ts +++ b/core/webpack-configs/src/react-docgen/index.ts @@ -4,7 +4,7 @@ export const reactDocgen: Configuration = { module: { rules: [ { - test: /\.(md|mdx)$/, + test: /\.mdx$/i, exclude: [/node_modules/], loader: '@component-controls/loader/loader', enforce: 'pre', diff --git a/core/webpack-configs/src/react/index.ts b/core/webpack-configs/src/react/index.ts index a2cf365cc..a9c6cb999 100644 --- a/core/webpack-configs/src/react/index.ts +++ b/core/webpack-configs/src/react/index.ts @@ -78,7 +78,7 @@ export const react: PresetType = (options: BuildProps) => { ], }, { - test: /\.(md|mdx)$/i, + test: /\.mdx$/i, exclude: [/node_modules/], loader: 'babel-loader', options: { @@ -100,7 +100,7 @@ export const react: PresetType = (options: BuildProps) => { }, }, { - test: /\.(eot|md|svg|ico|jpg|jpeg|png|gif|ttf|woff|woff2|pdf|mp4|web|wav|mp3|m4a|aac|oga)$/i, + test: /\.(eot|svg|ico|jpg|jpeg|png|gif|ttf|woff|woff2|pdf|mp4|web|wav|mp3|m4a|aac|oga)$/i, exclude: [/node_modules/], loader: 'url-loader', options: customLoaderOptions(options, 'url-loader', { @@ -167,9 +167,17 @@ export const react: PresetType = (options: BuildProps) => { }, ], }, - { - test: /\.(md|mdx)$/i, + test: /\.md$/i, + use: [ + { + loader: 'raw-loader', + options: customLoaderOptions(options, 'raw-loader', {}), + }, + ], + }, + { + test: /\.mdx$/i, exclude: [/node_modules/], loader: '@component-controls/loader/loader', enforce: 'pre',