You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
53 lines
1.3 KiB
53 lines
1.3 KiB
const build = require("./builder")
|
|
|
|
// Setup global environment
|
|
require("marko/node-require").install()
|
|
require("es6-promise").polyfill()
|
|
|
|
// Configure lasso
|
|
require("lasso").configure({
|
|
plugins: [
|
|
"lasso-marko",
|
|
"lasso-less",
|
|
],
|
|
outputDir: "./.static",
|
|
bundlingEnabled: true,
|
|
minify: true,
|
|
fingerprintsEnabled: true,
|
|
|
|
require: {
|
|
builtins: {
|
|
fs: require.resolve("empty-module"),
|
|
},
|
|
|
|
transforms: [
|
|
{
|
|
transform: "lasso-babel-transform",
|
|
config: {
|
|
extensions: [".js", ".es6"], // Enabled file extensions. Default: [".js", ".es6"]
|
|
babelOptions: {
|
|
presets: [ "es2015" ]
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|
|
})
|
|
|
|
// Render templates
|
|
async function buildAll() {
|
|
await build("./marko/page/story/list.marko")
|
|
await build("./marko/page/story/tag-list.marko", {tags: []})
|
|
await build("./marko/page/logs/list.marko")
|
|
await build("./marko/page/data/channels.marko", {channels: [], user: {}})
|
|
await build("./marko/page/data/characters.marko", {characters: [], user: {}})
|
|
await build("./marko/page/story-content/view.marko", {story: {chapters: []}})
|
|
await build("./marko/page/logs-content/view.marko", {log: {posts: [], channel: {}}})
|
|
}
|
|
|
|
buildAll().then(() => {
|
|
console.log("Done!")
|
|
}).catch(err => {
|
|
console.error(err)
|
|
process.exit(1)
|
|
})
|