Removing babel, upgrading inferno typescript build.
This commit is contained in:
parent
184fef4401
commit
72451998b5
|
@ -1,5 +1,5 @@
|
|||
cd ../server/ui
|
||||
yarn
|
||||
yarn build
|
||||
yarn build:prod
|
||||
cd ../service
|
||||
cargo run
|
||||
|
|
|
@ -1,12 +0,0 @@
|
|||
{
|
||||
"compact": false,
|
||||
"presets": [
|
||||
["es2015", {"loose": true, "modules": false}]
|
||||
],
|
||||
"plugins": [
|
||||
"transform-class-properties",
|
||||
"transform-object-rest-spread",
|
||||
"babel-plugin-syntax-jsx",
|
||||
["babel-plugin-inferno", {"imports": true}]
|
||||
]
|
||||
}
|
|
@ -4,9 +4,8 @@
|
|||
"description": "A simple UI for Torrents.csv",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1",
|
||||
"build": "webpack -p --display verbose",
|
||||
"lint": "tslint src/*.ts{,x} src/**/*.ts{,x}",
|
||||
"build:dev": "webpack",
|
||||
"build:prod": "webpack -p",
|
||||
"start": "webpack-dev-server --inline"
|
||||
},
|
||||
"keywords": [],
|
||||
|
@ -17,22 +16,15 @@
|
|||
"moment": "^2.22.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"babel-core": "^6.26.0",
|
||||
"babel-loader": "^7.1.2",
|
||||
"babel-plugin-inferno": "^5.1.0",
|
||||
"babel-plugin-syntax-object-rest-spread": "^6.13.0",
|
||||
"babel-plugin-transform-class-properties": "^6.24.1",
|
||||
"babel-plugin-transform-object-rest-spread": "^6.26.0",
|
||||
"babel-preset-es2015": "^6.24.1",
|
||||
"clean-webpack-plugin": "^0.1.18",
|
||||
"classcat": "^3.0.0",
|
||||
"clean-webpack-plugin": "^0.1.17",
|
||||
"css-loader": "^1.0.0",
|
||||
"html-webpack-plugin": "^2.30.1",
|
||||
"source-map-loader": "^0.2.3",
|
||||
"style-loader": "^0.23.1",
|
||||
"ts-loader": "^3.5.0",
|
||||
"tslint": "^5.9.1",
|
||||
"typescript": "^3.1.3",
|
||||
"webpack": "3.11.0",
|
||||
"webpack-dev-server": "2.11.1"
|
||||
"ts-transform-classcat": "^0.0.2",
|
||||
"ts-transform-inferno": "^3.0.2",
|
||||
"webpack": "^3.11.0",
|
||||
"webpack-dev-server": "^2.9.5"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
{
|
||||
"version": "2.2.2",
|
||||
"compilerOptions": {
|
||||
"target": "es6",
|
||||
"target": "es5",
|
||||
"module": "es6",
|
||||
"allowJs": false,
|
||||
"allowSyntheticDefaultImports": true,
|
||||
|
|
|
@ -1,31 +1,38 @@
|
|||
const webpack = require('webpack');
|
||||
const CleanWebpackPlugin = require('clean-webpack-plugin');
|
||||
const HtmlWebpackPlugin = require('html-webpack-plugin');
|
||||
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", // Point to main file
|
||||
entry: "./src/index.tsx",
|
||||
output: {
|
||||
path: __dirname + "/dist",
|
||||
path: path.resolve(__dirname, "dist/"),
|
||||
filename: "bundle.js"
|
||||
},
|
||||
resolve: {
|
||||
extensions: ['.js', '.jsx', '.ts', '.tsx']
|
||||
},
|
||||
performance: {
|
||||
hints: false
|
||||
mainFields: ['main'], // Important so Webpack resolves the main field of package.json for Classcat
|
||||
extensions: [".js", ".jsx", ".ts", ".tsx"]
|
||||
},
|
||||
module: {
|
||||
loaders: [
|
||||
rules: [
|
||||
{
|
||||
test: /\.tsx?$/, // All ts and tsx files will be process by
|
||||
loaders: ['babel-loader', 'ts-loader'], // first babel-loader, then ts-loader
|
||||
exclude: /node_modules/ // ignore node_modules
|
||||
}, {
|
||||
test: /\.jsx?$/, // all js and jsx files will be processed by
|
||||
loader: 'babel-loader', // babel-loader
|
||||
exclude: /node_modules/ // ignore node_modules
|
||||
test: /\.tsx$/,
|
||||
loader: "ts-loader",
|
||||
options: {
|
||||
getCustomTransformers: () => ({
|
||||
before: [transformClasscat(), transformInferno()]
|
||||
})
|
||||
}
|
||||
},
|
||||
{ test: /\.css$/, loader: "style-loader!css-loader" },
|
||||
{
|
||||
test: /\.ts$/,
|
||||
loader: "ts-loader"
|
||||
},
|
||||
{ test: /\.css$/, loader: "style-loader!css-loader" }
|
||||
]
|
||||
},
|
||||
devServer: {
|
||||
|
@ -33,18 +40,18 @@ module.exports = {
|
|||
historyApiFallback: true
|
||||
},
|
||||
plugins: [
|
||||
new HtmlWebpackPlugin(
|
||||
{
|
||||
new HtmlWebpackPlugin({
|
||||
template: "./src/index.html",
|
||||
inject: "body"
|
||||
}
|
||||
),
|
||||
new CleanWebpackPlugin(
|
||||
["dist"], {
|
||||
}),
|
||||
new CleanWebpackPlugin(["dist"], {
|
||||
verbose: true
|
||||
}
|
||||
),
|
||||
new webpack.HotModuleReplacementPlugin(),
|
||||
new webpack.ContextReplacementPlugin(/moment[\/\\]locale$/, /en-gb/)
|
||||
}),
|
||||
// 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()
|
||||
]
|
||||
};
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue