Make raw-loader more specific and use .js extension for jscad

suggestion for #519
This commit is contained in:
Kurt Hutten
2021-09-19 17:47:38 +10:00
parent 59df7fdc25
commit bb4659a2dd
4 changed files with 5 additions and 5 deletions

View File

@@ -6,7 +6,7 @@ module.exports = (config, { env }) => {
} }
}) })
config.module.rules.push({ config.module.rules.push({
test: /\.md$|\.jscad$|\.py$|\.SCAD$/i, test: /\.(md|jscad\.js|py|scad)$/i,
use: 'raw-loader', use: 'raw-loader',
}); });
return config return config

View File

@@ -2,6 +2,6 @@
// eliminates noisy TypeScript errors by registering these file endings as types. // eliminates noisy TypeScript errors by registering these file endings as types.
// Learned this method of registering modules from https://stackoverflow.com/a/57444766 // Learned this method of registering modules from https://stackoverflow.com/a/57444766
declare module "*.md"; declare module "*.md";
declare module "*.SCAD"; declare module "*.scad";
declare module "*.py"; declare module "*.py";
declare module "*.jscad"; declare module "*.jscad.js";

View File

@@ -7,11 +7,11 @@ import type {
} from 'src/helpers/cadPackages/common' } from 'src/helpers/cadPackages/common'
import { CadhubParams } from 'src/components/Customizer/customizerConverter' import { CadhubParams } from 'src/components/Customizer/customizerConverter'
import openScadGuide from 'src/helpers/cadPackages/openScad/userGuide.md' import openScadGuide from 'src/helpers/cadPackages/openScad/userGuide.md'
import openScadInitialCode from 'src/helpers/cadPackages/openScad/initialCode.SCAD' import openScadInitialCode from 'src/helpers/cadPackages/openScad/initialCode.scad'
import cadQueryGuide from 'src/helpers/cadPackages/cadQuery/userGuide.md' import cadQueryGuide from 'src/helpers/cadPackages/cadQuery/userGuide.md'
import cadQueryInitialCode from 'src/helpers/cadPackages/cadQuery/initialCode.py' import cadQueryInitialCode from 'src/helpers/cadPackages/cadQuery/initialCode.py'
import jsCadGuide from 'src/helpers/cadPackages/jsCad/userGuide.md' import jsCadGuide from 'src/helpers/cadPackages/jsCad/userGuide.md'
import jsCadInitialCode from 'src/helpers/cadPackages/jsCad/initialCode.jscad' import jsCadInitialCode from 'src/helpers/cadPackages/jsCad/initialCode.jscad.js'
function withThunk(dispatch, getState) { function withThunk(dispatch, getState) {