Browse Source

Remove react-scripts, comment out fuse.js

main
GreatBearShark 1 year ago
parent
commit
af724d5660
  1. 125
      fuse.js
  2. 7
      package.json
  3. 7888
      yarn.lock

125
fuse.js

@ -1,61 +1,66 @@
const {
FuseBox,
Sparky,
EnvPlugin,
CSSPlugin,
WebIndexPlugin,
QuantumPlugin,
} = require('fuse-box');
const transformInferno = require('ts-transform-inferno').default;
const transformClasscat = require('ts-transform-classcat').default;
let fuse, app;
let isProduction = false;
/**
* FUSEBOX IS NO LONGER USED FOR THIS PROJECT
* Keeping this as a reference for now in case there are problems with the new bundler down the road
*/
Sparky.task('config', _ => {
fuse = new FuseBox({
homeDir: 'src',
hash: isProduction,
output: 'dist/$name.js',
experimentalFeatures: true,
cache: !isProduction,
// sourceMaps: !isProduction,
sourceMaps: true,
transformers: {
before: [transformClasscat(), transformInferno()],
},
alias: {
locale: 'moment/locale',
},
plugins: [
EnvPlugin({ NODE_ENV: isProduction ? 'production' : 'development' }),
CSSPlugin(),
WebIndexPlugin({
title: 'Inferno Typescript FuseBox Example',
template: 'src/index.html',
path: isProduction ? '/static' : '/',
}),
isProduction &&
QuantumPlugin({
bakeApiIntoBundle: 'app',
treeshake: true,
uglify: true,
}),
],
});
app = fuse.bundle('app').instructions('>index.tsx');
});
Sparky.task('clean', _ => Sparky.src('dist/').clean('dist/'));
Sparky.task('env', _ => (isProduction = true));
Sparky.task('copy-assets', () =>
Sparky.src('assets/**/**.*').dest(isProduction ? 'dist/' : 'dist/static')
);
Sparky.task('dev', ['clean', 'config', 'copy-assets'], _ => {
fuse.dev({
fallback: 'index.html',
});
app.hmr().watch();
return fuse.run();
});
Sparky.task('prod', ['clean', 'env', 'config', 'copy-assets'], _ => {
return fuse.run();
});
// const {
// FuseBox,
// Sparky,
// EnvPlugin,
// CSSPlugin,
// WebIndexPlugin,
// QuantumPlugin,
// } = require('fuse-box');
// const transformInferno = require('ts-transform-inferno').default;
// const transformClasscat = require('ts-transform-classcat').default;
// let fuse, app;
// let isProduction = false;
// Sparky.task('config', _ => {
// fuse = new FuseBox({
// homeDir: 'src',
// hash: isProduction,
// output: 'dist/$name.js',
// experimentalFeatures: true,
// cache: !isProduction,
// // sourceMaps: !isProduction,
// sourceMaps: true,
// transformers: {
// before: [transformClasscat(), transformInferno()],
// },
// alias: {
// locale: 'moment/locale',
// },
// plugins: [
// EnvPlugin({ NODE_ENV: isProduction ? 'production' : 'development' }),
// CSSPlugin(),
// WebIndexPlugin({
// title: 'Inferno Typescript FuseBox Example',
// template: 'src/index.html',
// path: isProduction ? '/static' : '/',
// }),
// isProduction &&
// QuantumPlugin({
// bakeApiIntoBundle: 'app',
// treeshake: true,
// uglify: true,
// }),
// ],
// });
// app = fuse.bundle('app').instructions('>index.tsx');
// });
// Sparky.task('clean', _ => Sparky.src('dist/').clean('dist/'));
// Sparky.task('env', _ => (isProduction = true));
// Sparky.task('copy-assets', () =>
// Sparky.src('assets/**/**.*').dest(isProduction ? 'dist/' : 'dist/static')
// );
// Sparky.task('dev', ['clean', 'config', 'copy-assets'], _ => {
// fuse.dev({
// fallback: 'index.html',
// });
// app.hmr().watch();
// return fuse.run();
// });
// Sparky.task('prod', ['clean', 'env', 'config', 'copy-assets'], _ => {
// return fuse.run();
// });

7
package.json

@ -7,12 +7,8 @@
"scripts": {
"api-test": "jest src/api_tests/api.spec.ts",
"build": "node generate_translations.js && vite build",
"build_old": "node fuse prod",
"lint": "tsc --noEmit && eslint --report-unused-disable-directives --ext .js,.ts,.tsx src",
"prebuild": "node generate_translations.js",
"prestart": "node generate_translations.js",
"start": "node generate_translations.js && vite --port 4444",
"start_old": "node fuse dev"
"start": "node generate_translations.js && vite --port 4444"
},
"keywords": [],
"dependencies": {
@ -52,7 +48,6 @@
"react-dom": "^16.13.1",
"react-i18next": "^11.7.0",
"react-router-dom": "^5.2.0",
"react-scripts": "^3.4.1",
"reconnecting-websocket": "^4.4.0",
"register-service-worker": "^1.7.1",
"rxjs": "^6.5.5",

7888
yarn.lock
File diff suppressed because it is too large
View File

Loading…
Cancel
Save