upgraded build tools

This commit is contained in:
Gavin McDonald
2019-01-31 22:07:50 -05:00
parent 818bc3d433
commit 1557bbff4a
4 changed files with 1766 additions and 1681 deletions

View File

@@ -1,3 +0,0 @@
{
"presets": ["env"]
}

3421
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -4,7 +4,8 @@
"description": "", "description": "",
"main": "./public/js/tessellate.js", "main": "./public/js/tessellate.js",
"scripts": { "scripts": {
"build": "webpack --mode production", "build:dev": "webpack --mode development",
"build:prod": "webpack --mode production",
"test": "echo \"Error: no test specified\" && exit 1" "test": "echo \"Error: no test specified\" && exit 1"
}, },
"repository": { "repository": {
@@ -18,10 +19,10 @@
}, },
"homepage": "https://gitea.daggertrout.com/mcdoh/Tessellate#README", "homepage": "https://gitea.daggertrout.com/mcdoh/Tessellate#README",
"devDependencies": { "devDependencies": {
"babel-core": "^6.26.3", "@babel/core": "^7.2.2",
"babel-loader": "^7.1.4", "@babel/preset-env": "^7.3.1",
"babel-preset-env": "^1.7.0", "babel-loader": "^8.0.5",
"webpack": "^4.12.0", "webpack": "^4.29.0",
"webpack-cli": "^3.0.8" "webpack-cli": "^3.2.1"
} }
} }

View File

@@ -1,4 +1,5 @@
var path = require('path'); const path = require('path');
const mode = process.argv.slice(-1)[0];
module.exports = { module.exports = {
entry: { entry: {
@@ -10,13 +11,16 @@ module.exports = {
path: path.join(__dirname, 'public', 'js'), path: path.join(__dirname, 'public', 'js'),
filename: '[name].js' filename: '[name].js'
}, },
devtool: 'inline-source-map', devtool: mode === 'development' ? 'inline-source-map' : '',
module: { module: {
rules: [ rules: [
{ {
test: path.join(__dirname, 'src'), test: path.join(__dirname, 'src'),
use: { use: {
loader: 'babel-loader' loader: 'babel-loader',
options: {
presets: ['@babel/preset-env']
}
} }
} }
] ]