Switching to fusebox inferno build instead.
This commit is contained in:
parent
72451998b5
commit
3713a878e7
|
@ -1,5 +1,5 @@
|
||||||
cd ../server/ui
|
cd ../server/ui
|
||||||
yarn
|
yarn
|
||||||
yarn build:prod
|
yarn build
|
||||||
cd ../service
|
cd ../service
|
||||||
cargo run
|
cargo run
|
||||||
|
|
|
@ -0,0 +1,53 @@
|
||||||
|
const {
|
||||||
|
FuseBox,
|
||||||
|
Sparky,
|
||||||
|
EnvPlugin,
|
||||||
|
CSSPlugin,
|
||||||
|
WebIndexPlugin,
|
||||||
|
QuantumPlugin,
|
||||||
|
} = require('fuse-box');
|
||||||
|
// const transformInferno = require('../../dist').default
|
||||||
|
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,
|
||||||
|
transformers: {
|
||||||
|
before: [transformClasscat(), transformInferno()],
|
||||||
|
},
|
||||||
|
plugins: [
|
||||||
|
EnvPlugin({ NODE_ENV: isProduction ? 'production' : 'development' }),
|
||||||
|
CSSPlugin(),
|
||||||
|
WebIndexPlugin({
|
||||||
|
title: 'Inferno Typescript FuseBox Example',
|
||||||
|
template: 'src/index.html',
|
||||||
|
}),
|
||||||
|
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('dev', ['clean', 'config'], _ => {
|
||||||
|
fuse.dev();
|
||||||
|
app.hmr().watch();
|
||||||
|
return fuse.run();
|
||||||
|
});
|
||||||
|
Sparky.task('prod', ['clean', 'env', 'config'], _ => {
|
||||||
|
// fuse.dev({ reload: true }); // remove after demo
|
||||||
|
return fuse.run();
|
||||||
|
});
|
|
@ -4,27 +4,22 @@
|
||||||
"description": "A simple UI for Torrents.csv",
|
"description": "A simple UI for Torrents.csv",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build:dev": "webpack",
|
"start": "node fuse dev",
|
||||||
"build:prod": "webpack -p",
|
"build": "node fuse prod"
|
||||||
"start": "webpack-dev-server --inline"
|
|
||||||
},
|
},
|
||||||
"keywords": [],
|
"keywords": [],
|
||||||
"author": "Dominic Gannaway",
|
"author": "Dominic Gannaway",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"inferno": "^5.6.1",
|
"inferno": "^6.0.3",
|
||||||
"moment": "^2.22.2"
|
"moment": "^2.22.2",
|
||||||
|
"classcat": "^1.1.3"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"classcat": "^3.0.0",
|
"fuse-box": "^3.1.3",
|
||||||
"clean-webpack-plugin": "^0.1.17",
|
|
||||||
"css-loader": "^1.0.0",
|
|
||||||
"html-webpack-plugin": "^2.30.1",
|
|
||||||
"style-loader": "^0.23.1",
|
|
||||||
"ts-loader": "^3.5.0",
|
|
||||||
"ts-transform-classcat": "^0.0.2",
|
"ts-transform-classcat": "^0.0.2",
|
||||||
"ts-transform-inferno": "^3.0.2",
|
"ts-transform-inferno": "^3.0.2",
|
||||||
"webpack": "^3.11.0",
|
"typescript": "^2.7.1",
|
||||||
"webpack-dev-server": "^2.9.5"
|
"uglify-es": "^3.3.9"
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -16,6 +16,7 @@
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<div id="app"></div>
|
<div id="app"></div>
|
||||||
|
$bundles
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
|
@ -1,57 +0,0 @@
|
||||||
const webpack = require('webpack');
|
|
||||||
const CleanWebpackPlugin = require("clean-webpack-plugin");
|
|
||||||
const HtmlWebpackPlugin = require("html-webpack-plugin");
|
|
||||||
|
|
||||||
const path = require("path");
|
|
||||||
const transformInferno = require("ts-transform-inferno").default;
|
|
||||||
// const transformInferno = require('../../dist').default
|
|
||||||
const transformClasscat = require('ts-transform-classcat').default;
|
|
||||||
|
|
||||||
module.exports = {
|
|
||||||
entry: "./src/index.tsx",
|
|
||||||
output: {
|
|
||||||
path: path.resolve(__dirname, "dist/"),
|
|
||||||
filename: "bundle.js"
|
|
||||||
},
|
|
||||||
resolve: {
|
|
||||||
mainFields: ['main'], // Important so Webpack resolves the main field of package.json for Classcat
|
|
||||||
extensions: [".js", ".jsx", ".ts", ".tsx"]
|
|
||||||
},
|
|
||||||
module: {
|
|
||||||
rules: [
|
|
||||||
{
|
|
||||||
test: /\.tsx$/,
|
|
||||||
loader: "ts-loader",
|
|
||||||
options: {
|
|
||||||
getCustomTransformers: () => ({
|
|
||||||
before: [transformClasscat(), transformInferno()]
|
|
||||||
})
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
test: /\.ts$/,
|
|
||||||
loader: "ts-loader"
|
|
||||||
},
|
|
||||||
{ test: /\.css$/, loader: "style-loader!css-loader" }
|
|
||||||
]
|
|
||||||
},
|
|
||||||
devServer: {
|
|
||||||
contentBase: "src/",
|
|
||||||
historyApiFallback: true
|
|
||||||
},
|
|
||||||
plugins: [
|
|
||||||
new HtmlWebpackPlugin({
|
|
||||||
template: "./src/index.html",
|
|
||||||
inject: "body"
|
|
||||||
}),
|
|
||||||
new CleanWebpackPlugin(["dist"], {
|
|
||||||
verbose: true
|
|
||||||
}),
|
|
||||||
// By default, webpack does `n=>n` compilation with entry files. This concatenates
|
|
||||||
// them into a single chunk.
|
|
||||||
new webpack.optimize.LimitChunkCountPlugin({
|
|
||||||
maxChunks: 1
|
|
||||||
}),
|
|
||||||
new webpack.HotModuleReplacementPlugin()
|
|
||||||
]
|
|
||||||
};
|
|
3186
server/ui/yarn.lock
3186
server/ui/yarn.lock
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue