Add Txiki.js Adapter.

This commit is contained in:
2022-07-03 11:00:26 +00:00
committed by GitHub
parent 057c9b9cb5
commit 6559a3f134
10 changed files with 278 additions and 5 deletions

View File

@ -8,6 +8,8 @@ const __dirname = path.dirname(__filename);
const isProduction = process.env.NODE_ENV == "production";
import webpack from "webpack";
const config = {
output: {
path: path.resolve(__dirname, "dist"),
@ -35,7 +37,8 @@ const config = {
resolve: {
extensions: [".tsx", ".ts", ".jsx", ".js", "..."],
fallback: {
"http": false
"http": false,
"async_hooks": false,
}
},
experiments: {
@ -69,6 +72,15 @@ export default () => {
config.target = "webworker";
config.output.filename = "main.cfworker.js";
break;
case "txiki":
config.mode = "production";
config.target = "es2021";
config.output.filename = "main.txiki.js";
config.plugins.push(
new webpack.ProvidePlugin({
'Promise': 'bluebird'
})
)
default:
config.target = "es6";
}