Skip to content

Commit

Permalink
only temp
Browse files Browse the repository at this point in the history
  • Loading branch information
fs-context committed Dec 16, 2024
1 parent 1e96337 commit c828f80
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 9 deletions.
2 changes: 1 addition & 1 deletion config/loader.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ExtensionLoadError } from "@framework/exceptions";
type LoaderConfig = import("@framework/internal").LoaderConfig;
const config: LoaderConfig = {
target: import("@samples/py/extension"),
target: import("@src/extension"),
errorCatches: [Error, ExtensionLoadError],
platform: ["TurboWarp"]
};
Expand Down
3 changes: 3 additions & 0 deletions config/test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
const { merge } = require("webpack-merge");
merge({
});
4 changes: 2 additions & 2 deletions config/webpack.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const loaderRule = [
{
test: /\.ts$/i,
use: "ts-loader",
exclude: /\.d\.ts$/i
// exclude: /\.d\.ts$/i
},
{
test: /\.(html|md)$/i,
Expand Down Expand Up @@ -44,6 +44,6 @@ const devServer = {
* @type {import("webpack").Configuration}
*/
const staticShow = {
stats: "errors-only"
stats: "normal"
};
module.exports = { loaderRule, alias, fileExtensions, devServer, staticShow };
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"webpack": "^5.96.1",
"webpack-cli": "^5.1.4",
"webpack-dev-server": "^5.1.0",
"webpack-merge": "^6.0.1",
"webpackbar": "^7.0.0"
},
"dependencies": {
Expand Down
3 changes: 2 additions & 1 deletion src/fs-context/entry.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Extensions } from ".";
import type { ScratchWaterBoxed } from "@framework/internal";
export default async function load() {
const currentScratch = Extensions.getScratch() as import("@framework/internal").ScratchWaterBoxed;
const currentScratch = Extensions.getScratch() as ScratchWaterBoxed;
if (currentScratch) {
const loaderConfig = Extensions.config.loader;
const { default: target } = await loaderConfig.target;
Expand Down
2 changes: 1 addition & 1 deletion src/fs-context/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ExtensionLoadError, UncognizedError } from "./exceptions";
import { ArgumentPlain, BlockPlain, ExtensionPlain, GlobalResourceMachine, HexColorString, LoaderConfig, MenuPlain, ObjectInclude, PlatformSupported, Scratch, ScratchWaterBoxed } from "./internal";
import { Extension } from "./structs";
import loaderConfig from "@config/loader";
import type { Extension } from "./structs";
if (!window._FSContext) {
// 这个判断有点史,优化下
window._FSContext = {
Expand Down
12 changes: 8 additions & 4 deletions webpack.config.ext.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,9 @@ module.exports = {
entry: "@framework/entry.ts",
output: {
// filename: `${serverConfig.extension.output}.dist.js`,
filename:"[name].dist.js",
filename: "[name].dist.js",
path: path.resolve(__dirname, `dist/${serverConfig.extension.output}`),
clean: true,
library: serverConfig.extension.output,
libraryTarget: "window"
clean: true
},
module: {
rules: [
Expand Down Expand Up @@ -53,5 +51,11 @@ module.exports = {
hot: false,
liveReload: false,
webSocketServer: false
},
optimization: {
splitChunks: {
chunks: "initial"
},
runtimeChunk: false
}
};

0 comments on commit c828f80

Please sign in to comment.