@_tc/template-core 0.0.1-bate.22 → 0.0.1-bate.24
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.
|
@@ -7,8 +7,7 @@ const paths_1 = require("../../packages/core/paths");
|
|
|
7
7
|
const nunjucks_1 = __importDefault(require("nunjucks"));
|
|
8
8
|
const path_1 = __importDefault(require("path"));
|
|
9
9
|
exports.default = (app) => {
|
|
10
|
-
const viewsPath = path_1.default.join((0, paths_1.getAppPath)(app,
|
|
11
|
-
console.log(viewsPath);
|
|
10
|
+
const viewsPath = path_1.default.join((0, paths_1.getAppPath)(app, 'frame'), "./public");
|
|
12
11
|
const env = nunjucks_1.default.configure(viewsPath, {
|
|
13
12
|
autoescape: true,
|
|
14
13
|
throwOnUndefined: false,
|
|
@@ -19,10 +18,6 @@ exports.default = (app) => {
|
|
|
19
18
|
});
|
|
20
19
|
app.extends.nunjucksEnv = env;
|
|
21
20
|
return (view, ctx, context) => {
|
|
22
|
-
console.log("view ---- >", view);
|
|
23
|
-
console.log(env.options);
|
|
24
|
-
console.log(env.opts);
|
|
25
|
-
console.log(env.loaders[0]);
|
|
26
21
|
ctx.body = env.render(view, Object.assign({}, ctx.state, context));
|
|
27
22
|
};
|
|
28
23
|
};
|
package/cjs/bundler/utils.js
CHANGED
|
@@ -185,6 +185,11 @@ function flattenHtmlPlugin(suffix = ".html") {
|
|
|
185
185
|
delEmptyDir(fullPath);
|
|
186
186
|
}
|
|
187
187
|
}
|
|
188
|
+
// 输出最终的 文件路径
|
|
189
|
+
const endFiles = glob.sync("**/*.html", { cwd: feDir });
|
|
190
|
+
for (const f of endFiles) {
|
|
191
|
+
console.log("final file path -----> ", f);
|
|
192
|
+
}
|
|
188
193
|
},
|
|
189
194
|
};
|
|
190
195
|
}
|
|
@@ -2,8 +2,7 @@ import { getAppPath } from "../../packages/core/paths";
|
|
|
2
2
|
import nunjucks from "nunjucks";
|
|
3
3
|
import path from "path";
|
|
4
4
|
export default (app) => {
|
|
5
|
-
const viewsPath = path.join(getAppPath(app,
|
|
6
|
-
console.log(viewsPath);
|
|
5
|
+
const viewsPath = path.join(getAppPath(app, 'frame'), "./public");
|
|
7
6
|
const env = nunjucks.configure(viewsPath, {
|
|
8
7
|
autoescape: true,
|
|
9
8
|
throwOnUndefined: false,
|
|
@@ -14,10 +13,6 @@ export default (app) => {
|
|
|
14
13
|
});
|
|
15
14
|
app.extends.nunjucksEnv = env;
|
|
16
15
|
return (view, ctx, context) => {
|
|
17
|
-
console.log("view ---- >", view);
|
|
18
|
-
console.log(env.options);
|
|
19
|
-
console.log(env.opts);
|
|
20
|
-
console.log(env.loaders[0]);
|
|
21
16
|
ctx.body = env.render(view, Object.assign({}, ctx.state, context));
|
|
22
17
|
};
|
|
23
18
|
};
|
package/esm/bundler/utils.js
CHANGED
|
@@ -143,6 +143,11 @@ function flattenHtmlPlugin(suffix = ".html") {
|
|
|
143
143
|
delEmptyDir(fullPath);
|
|
144
144
|
}
|
|
145
145
|
}
|
|
146
|
+
// 输出最终的 文件路径
|
|
147
|
+
const endFiles = glob.sync("**/*.html", { cwd: feDir });
|
|
148
|
+
for (const f of endFiles) {
|
|
149
|
+
console.log("final file path -----> ", f);
|
|
150
|
+
}
|
|
146
151
|
},
|
|
147
152
|
};
|
|
148
153
|
}
|