Skip to content

Commit

Permalink
add generate z-uno-compiler.script
Browse files Browse the repository at this point in the history
  • Loading branch information
amatilda committed Aug 26, 2024
1 parent 5038c9c commit be3f896
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion webpack.z-uno-compiler.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
const HtmlWebpackPlugin = require('html-webpack-plugin')
const common = require("./webpack.common.js")

const template_html = '<script src="/files/z-uno2/Z-Uno-Compiler{{beta}}/z-uno-compiler.js?{{version}}"></script>'

module.exports = function(env, argv) {
return (common.common(env, argv, './src/z-uno-compiler.ts', 'z-uno-compiler.js', 'ZUnoCompiler'));
let template_html_replace;

if (common.beta == true)
template_html_replace = "-beta";
else
template_html_replace = "";
const config = common.common(env, argv, './src/z-uno-compiler.ts', 'z-uno-compiler.js', 'ZUnoCompiler');
config.plugins.push(
new HtmlWebpackPlugin({
inject: false,
templateContent:template_html.replace(new RegExp("{{beta}}", 'g'), template_html_replace).replace(new RegExp("{{version}}", 'g'), common.web_tools_version),
filename: 'z-uno-compiler.script',
}),
);
return (config);
};

0 comments on commit be3f896

Please sign in to comment.