Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
mizok committed Apr 18, 2022
1 parent f4c503e commit 099f6d3
Show file tree
Hide file tree
Showing 7 changed files with 51 additions and 6 deletions.
31 changes: 31 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
"postcss-preset-env": "^6.7.0",
"sass": "^1.33.0",
"sass-loader": "^12.0.0",
"shader-loader": "^1.3.1",
"style-loader": "^2.0.0",
"template-ejs-loader": "latest",
"terser-webpack-plugin": "^5.3.1",
Expand All @@ -56,4 +57,4 @@
"> 1%",
"IE 10"
]
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import '../util/main';
@import '../../util/main';

.centered {
display: flex;
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
21 changes: 17 additions & 4 deletions webpack.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,14 @@ const getEntriesByParsingTemplateNames = (templatesFolderName, atRoot = true) =>

const entryDependency = atRoot ? entryName : `${templatesFolderName}/${entryName}`

let entryPath = resolve(__dirname, `src/ts/${entryDependency}.ts`);
let entryPath1 = resolve(__dirname, `src/ts/${entryDependency}.ts`);
let entryPath2 = resolve(__dirname, `src/ts/${entryDependency}/main.ts`);
// entry stylesheet
let entryStyleSheetPath = resolve(__dirname, `./src/scss/${entryDependency}.scss`);
entryPath = fs.existsSync(entryPath) ? entryPath : undefined;
entryStyleSheetPath = fs.existsSync(entryStyleSheetPath) ? entryStyleSheetPath : undefined;
let entryStyleSheetPath1 = resolve(__dirname, `./src/scss/${entryDependency}.scss`);
let entryStyleSheetPath2 = resolve(__dirname, `./src/scss/${entryDependency}/main.scss`);

const entryPath = fs.existsSync(entryPath1) ? entryPath1 : fs.existsSync(entryPath2)? entryPath2:undefined;
const entryStyleSheetPath = fs.existsSync(entryStyleSheetPath1) ? entryStyleSheetPath1 : fs.existsSync(entryStyleSheetPath2)? entryStyleSheetPath2: undefined;

// import es6-promise and scss util automatically
entryObj[entryName] = ['es6-promise/auto', entryPath, './src/scss/reset.scss', entryStyleSheetPath].filter(function (x: string | undefined) {
Expand Down Expand Up @@ -133,6 +136,15 @@ const config = (env: any, argv: any): webpack.Configuration => {
}
],
},
{
test: /\.(glsl|vert|frag)$/,
loader: 'shader-loader',
options: {
glsl: {
chunkPath: resolve("/glsl/chunks")
}
}
},
{
test: /\.ejs$/,
use: [
Expand Down Expand Up @@ -200,6 +212,7 @@ const config = (env: any, argv: any): webpack.Configuration => {
]
},
resolve: {
extensions:['.ts','.tsx','.js','.jsx','json'],
alias: {
'@img': resolve(__dirname, './src/assets/images/'),
'@font': resolve(__dirname, './src/assets/fonts/')
Expand Down

0 comments on commit 099f6d3

Please sign in to comment.