feat: widget sdk

This commit is contained in:
Tristan Yang
2022-10-27 21:21:54 +08:00
parent 23320ab637
commit 1987c257ba
25 changed files with 456 additions and 96 deletions
+2 -2
View File
@@ -58,8 +58,8 @@ module.exports = {
appPublic: resolveApp("public"),
appHtml: resolveApp("public/index.html"),
appIndexJs: resolveModule(resolveApp, "src/index"),
embedAppHtml: resolveApp("public/embed.html"),
embedAppIndexJs: resolveModule(resolveApp, "src/embed"),
widgetAppHtml: resolveApp("public/widget.html"),
widgetAppIndexJs: resolveModule(resolveApp, "src/index-widget"),
appPackageJson: resolveApp("package.json"),
appSrc: resolveApp("src"),
appTsConfig: resolveApp("tsconfig.json"),
+4 -4
View File
@@ -133,7 +133,7 @@ module.exports = function (webpackEnv) {
: isEnvDevelopment && "cheap-module-source-map",
// These are the "entry points" to our application.
// This means they will be the "root" imports that are included in JS bundle.
entry: { main: paths.appIndexJs, embed: paths.embedAppIndexJs },
entry: { main: paths.appIndexJs, widget: paths.widgetAppIndexJs },
output: {
// The build folder.
path: paths.appBuild,
@@ -439,10 +439,10 @@ module.exports = function (webpackEnv) {
Object.assign(
{},
{
filename: "embed.html",
filename: "widget.html",
inject: true,
template: paths.embedAppHtml,
chunks: ["embed"]
template: paths.widgetAppHtml,
chunks: ["widget"]
},
isEnvProduction
? {