-
got it!
+{{ end }}
+{{ with .Data }}
+{{ if has . "Job" }}
+
{{ end }}
-
OR
-
OR
-
+{{ end }}
+
{{ end }}
\ No newline at end of file
diff --git a/templates/views/profile/get.html b/templates/views/profile/get.html
new file mode 100644
index 0000000..38a7c06
--- /dev/null
+++ b/templates/views/profile/get.html
@@ -0,0 +1,5 @@
+{{ define "main" }}
+
+{{ end }}
\ No newline at end of file
diff --git a/templates/views/resource/get.html b/templates/views/resource/get.html
new file mode 100644
index 0000000..590157f
--- /dev/null
+++ b/templates/views/resource/get.html
@@ -0,0 +1,19 @@
+{{ define "main" }}
+{{ with .Data }}
+{{ if .Item }}
+
+ {{ template "file" $ }}
+
+{{ end }}
+{{ if and .Item .List }}
+
+{{ end }}
+{{ if .List }}
+
+{{ template "list" $ }}
+
+{{ end }}
+{{ end }}
+
+{{ if dev }}{{ end }}
+{{ end }}
\ No newline at end of file
diff --git a/webpack.config.js b/webpack.config.js
index e4f24f5..ab75269 100644
--- a/webpack.config.js
+++ b/webpack.config.js
@@ -3,22 +3,35 @@ const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const CssMinimizerPlugin = require('css-minimizer-webpack-plugin');
const CopyPlugin = require('copy-webpack-plugin');
-module.exports = (env, options) => {
+const fs = require('fs');
+
+function getEntries(path, prefix = '') {
+ return new Promise((resolve) => {
+ fs.readdir(path, { recursive: true }, (err, files) => {
+ const entries = {};
+ for (const f of files) {
+ if (f.endsWith('.js')) entries[prefix + f.replace('.js', '')] = path + '/' + f;
+ }
+ resolve(entries);
+ });
+ })
+}
+
+module.exports = async (env, options) => {
+ const entries = await getEntries('./assets/src/js/app');
const devMode = options.mode !== 'production';
- const devEntries = devMode ? {
- "dev/browse": './assets/src/dev/browse.js'
- } : {};
+ const devEntries = devMode ? await getEntries('./assets/src/js/dev', 'dev/') : {};
return {
entry: {
- index: './assets/src/index.js',
- action: './assets/src/action.js',
- player: './assets/src/player.js',
- layout: './assets/src/layout.js',
+ ...entries,
...devEntries,
},
+ devtool: 'source-map',
output: {
filename: '[name].js',
+ chunkFilename: '[name].[chunkhash].js',
path: path.resolve(__dirname, 'assets', 'dist'),
+ clean: true,
},
devServer: {
port: 8082,
@@ -29,8 +42,8 @@ module.exports = (env, options) => {
watchFiles: ['templates/*.html', 'assets/src/*'],
},
optimization: {
+ // splitChunks: {},
minimizer: [
- `...`,
new CssMinimizerPlugin({
minimizerOptions: {
preset: [
@@ -48,7 +61,7 @@ module.exports = (env, options) => {
{
test: /\.js$/,
include: path.resolve(__dirname, 'assets', 'src'),
- loader: 'babel-loader',
+ loader: 'babel-loader'
},
{
test: /\.css$/i,