1
0
mirror of https://github.com/teoxoy/factorio-blueprint-editor.git synced 2025-01-16 02:33:23 +02:00

switched from webpack to parcel

This commit is contained in:
Teoxoy 2018-09-14 20:51:34 +02:00
parent 6feb6bed22
commit 3939abeba5
9 changed files with 4351 additions and 8243 deletions

2
.gitignore vendored
View File

@ -1,5 +1,5 @@
node_modules
.wwp-cache
.cache
dist
*.log
parser/temp

12422
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -4,16 +4,19 @@
"description": "",
"main": "index.js",
"scripts": {
"start": "webpack-dev-server --config webpack.dev.js --host 0.0.0.0 --open --useLocalIp",
"build": "webpack --config webpack.prod.js",
"start": "parcel src/index.html",
"prebuild": "rimraf dist",
"build": "rimraf dist && cpx src/spritesheets/* dist/spritesheets && parcel build src/index.html",
"setupDist": "git worktree add dist gh-pages",
"deploy": "cd dist && git add --all && git reset -- stats && git commit -m \"new version\" && git push origin gh-pages"
},
"author": "Teoxoy",
"license": "MIT",
"browserslist": [
"> 5%",
"last 3 versions"
"last 2 Chrome versions",
"last 2 Firefox versions",
"last 2 Safari versions",
"last 2 Edge versions"
],
"dependencies": {
"@pixi/filter-adjustment": "^2.5.0",
@ -25,32 +28,16 @@
"pixi.js": "^4.8.1"
},
"devDependencies": {
"@babel/core": "^7.0.0-beta.55",
"@babel/preset-env": "^7.0.0-beta.55",
"@types/keyboardjs": "^2.2.31",
"@types/pixi.js": "^4.8.0",
"babel-loader": "^8.0.0-beta.4",
"clean-webpack-plugin": "^0.1.19",
"copy-webpack-plugin": "^4.5.2",
"css-loader": "^1.0.0",
"extract-text-webpack-plugin": "^4.0.0-beta.0",
"fork-ts-checker-webpack-plugin": "^0.4.4",
"cpx": "^1.5.0",
"fs-extra": "^7.0.0",
"html-webpack-plugin": "3.2.0",
"jimp": "^0.3.1",
"lua2js": "git+https://github.com/Teoxoy/lua2js.git",
"node-sprite-generator": "^0.10.2",
"optimize-css-assets-webpack-plugin": "^5.0.0",
"ts-loader": "^4.4.2",
"parcel-bundler": "^1.9.7",
"rimraf": "^2.6.2",
"tslint": "^5.11.0",
"typescript": "^3.0.1",
"webapp-webpack-plugin": "^1.3.1",
"webpack": "^4.16.4",
"webpack-bundle-analyzer": "^2.13.1",
"webpack-cli": "^3.1.0",
"webpack-closure-compiler": "^2.1.6",
"webpack-dev-server": "^3.1.5",
"webpack-merge": "^4.1.4",
"webpack-visualizer-plugin": "^0.1.11"
"typescript": "^3.0.1"
}
}

BIN
src/favicon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

File diff suppressed because one or more lines are too long

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

View File

@ -1,83 +0,0 @@
'use strict'
// https://medium.com/webpack/webpack-4-mode-and-optimization-5423a6bc597a
const path = require('path')
const ExtractTextPlugin = require('extract-text-webpack-plugin')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const CleanWebpackPlugin = require('clean-webpack-plugin')
const FaviconsWebpackPlugin = require('webapp-webpack-plugin') // favicons-webpack-plugin
const CopyWebpackPlugin = require('copy-webpack-plugin')
const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin')
const extractPlugin = new ExtractTextPlugin({
filename: '[name].css',
allChunks: true
})
const babelLoader = {
loader: 'babel-loader',
options: {
cacheDirectory: true,
presets: [['@babel/preset-env', { useBuiltIns: 'entry' }]]
}
}
module.exports = {
target: 'web',
entry: {
main: './src/app'
},
output: {
path: path.resolve(__dirname, './dist'),
filename: '[name].js'
},
resolve: {
extensions: ['.js', '.json', '.ts']
},
module: {
rules: [
{
test: /\.js$/,
exclude: /node_modules/,
use: [
babelLoader
]
},
{
test: /\.ts?$/,
exclude: /node_modules/,
use: [
babelLoader,
{
loader: 'ts-loader',
options: { transpileOnly: true }
}
]
},
{
test: /normalize.css/,
use: extractPlugin.extract({
use: ['css-loader']
})
}
]
},
plugins: [
new HtmlWebpackPlugin({
template: 'src/index.html',
hash: true
}),
extractPlugin,
new FaviconsWebpackPlugin({
logo: './src/logo.png'
}),
// https://github.com/ProvidenceGeeks/website-frontend/pull/142
new CopyWebpackPlugin([
{ from: 'src/spritesheets', to: 'spritesheets'/*'factorio-data/bundles/[name].[hash].[ext]'*/ }
]),
new CleanWebpackPlugin(['dist/*.*'], { exclude: ['.git'] }),
new ForkTsCheckerWebpackPlugin({
tslint: true,
watch: ['./src']
})
]
}

View File

@ -1,9 +0,0 @@
'use strict'
const merge = require('webpack-merge')
const common = require('./webpack.common.js')
module.exports = merge(common, {
mode: 'development'
// devtool: 'inline-source-map'
})

View File

@ -1,39 +0,0 @@
'use strict'
const merge = require('webpack-merge')
const common = require('./webpack.common.js')
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin
const Visualizer = require('webpack-visualizer-plugin')
const OptimizeCssAssetsPlugin = require('optimize-css-assets-webpack-plugin')
//const ClosureCompilerPlugin = require('webpack-closure-compiler')
// https://webpack.github.io/analyse/
module.exports = merge(common, {
mode: 'production',
profile: true,
plugins: [
new OptimizeCssAssetsPlugin({
cssProcessorOptions: { discardComments: { removeAll: true } }
}),
new BundleAnalyzerPlugin({
reportFilename: './stats/report.html',
analyzerMode: 'static',
openAnalyzer: false,
generateStatsFile: true,
statsFilename: './stats/stats.json'
}),
new Visualizer({
filename: './stats/statistics.html'
})
// new ClosureCompilerPlugin({
// compiler: {
// language_in: 'ECMASCRIPT6',
// language_out: 'ECMASCRIPT5',
// compilation_level: 'ADVANCED'
// },
// jsCompiler: true,
// concurrency: 3,
// })
]
})