-
Notifications
You must be signed in to change notification settings - Fork 277
Build configuration #175
base: master
Are you sure you want to change the base?
Build configuration #175
Changes from all commits
7113a12
f5ec0d6
d9f4271
8e7bf61
b417d6c
353c252
c969fe9
2dc2ba4
b7e3a4a
65b2e60
7948910
afdafd6
6fe18e1
7efc404
057d804
8fd93e2
bfdf4b4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"presets": ["es2015"] | ||
} | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,4 @@ | |
node_modules | ||
*.log | ||
.DS_Store | ||
.idea | ||
build | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why did you get rid of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh! I'll make the change. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
const webpack = require("webpack"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. single quotes please! (I'm surprised the linter didn't catch that, maybe it doesn't check for it - will open an issue) |
||
const path = require("path"); | ||
const BabiliPlugin = require("babili-webpack-plugin"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. looks like this isn't used? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oops! Yup. We rely on |
||
const CleanWebpackPlugin = require("clean-webpack-plugin"); | ||
|
||
module.exports = { | ||
entry: path.resolve(__dirname, "../index.js"), | ||
output: { | ||
path: path.resolve(__dirname, "../build"), | ||
filename: "mathsteps.min.js", | ||
libraryTarget: "umd", | ||
library: "mathsteps" | ||
}, | ||
externals: { | ||
mathjs: "mathjs" | ||
}, | ||
module: { | ||
rules: [ | ||
{ | ||
test: /\.js$/, | ||
exclude: [/node_modules/, /scripts/, /test/, /Config/], | ||
use: ["babel-loader"] | ||
} | ||
] | ||
}, | ||
plugins: [ | ||
new webpack.LoaderOptionsPlugin({ // Options for loader that will run on files | ||
minimize: true, | ||
debug: false, | ||
options: { | ||
context: __dirname | ||
} | ||
}), | ||
new webpack.optimize.ModuleConcatenationPlugin(), // Webpack 3 (scope hoisting) | ||
new webpack.optimize.UglifyJsPlugin(), // Minifier | ||
new webpack.DefinePlugin({ // Production ready build | ||
"process.env": { | ||
NODE_ENV: JSON.stringify("production") | ||
} | ||
}), | ||
new CleanWebpackPlugin([path.resolve(__dirname, "../build")]) // Prebuild (kinda hook) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you update the comments in this file to explain a bit better what things do? I'm not super familiar with webpack but will look some of this stuff up - but if you could go through this config and explain why you chose this config that'd be good too - thanks! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Don't worry! I will comment the configuration and will make it easier for you also to make changes afterwards. |
||
] | ||
}; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. new lineeeee (added to the linter issue) |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,23 +2,34 @@ | |
"name": "mathsteps", | ||
"version": "0.1.6", | ||
"description": "Step by step math solutions", | ||
"main": "index.js", | ||
"main": "./build/mathsteps.min.js", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. if |
||
"dependencies": { | ||
"mathjs": "3.11.2" | ||
}, | ||
"engines": { | ||
"node": ">=6.0.0" | ||
}, | ||
"files": [ | ||
"build" | ||
], | ||
"devDependencies": { | ||
"babel-core": "^6.25.0", | ||
"babel-loader": "^7.1.1", | ||
"babel-preset-es2015": "^6.24.1", | ||
"babili-webpack-plugin": "^0.1.2", | ||
"clean-webpack-plugin": "^0.1.16", | ||
"eslint": "^3.10.2", | ||
"eslint-config-google": "^0.7.0", | ||
"eslint-plugin-sort-requires": "^2.1.0", | ||
"mocha": "2.4.5" | ||
"mocha": "2.4.5", | ||
"webpack": "^3.0.0" | ||
}, | ||
"scripts": { | ||
"lint": "node_modules/.bin/eslint .", | ||
"test": "node_modules/.bin/mocha --recursive", | ||
"setup-hooks": "ln -s ../../scripts/git-hooks/pre-commit.sh .git/hooks/pre-commit" | ||
"build": "NODE_ENV=production ./node_modules/.bin/webpack --config ./config/webpack.config.js --display-max-modules 0", | ||
"lint": "node_modules/.bin/eslint ./lib", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this removes linting from the test files, which I don't think we should do |
||
"prebuild": "rm -rf ./build", | ||
"setup-hooks": "ln -s ../../scripts/git-hooks/pre-commit.sh .git/hooks/pre-commit", | ||
"test": "node_modules/.bin/mocha --recursive" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
new line at end of file pls!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I need to configure prettier settings!