Skip to content
This repository was archived by the owner on Dec 5, 2019. It is now read-only.

Commit d295a5e

Browse files
committed
chore: Update to webpack-defaults
Closes #24.
1 parent 010e5b1 commit d295a5e

20 files changed

+2388
-1054
lines changed

.babelrc

+33-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,38 @@
11
{
22
"presets": [
3-
"es2015"
3+
"es2015",
4+
[
5+
"env",
6+
{
7+
"useBuiltIns": true,
8+
"targets": {
9+
"node": "4.3"
10+
},
11+
"exclude": [
12+
"transform-async-to-generator",
13+
"transform-regenerator"
14+
]
15+
}
16+
]
417
],
518
"plugins": [
619
"syntax-object-rest-spread",
7-
"transform-object-rest-spread"
8-
]
9-
}
20+
"transform-object-rest-spread",
21+
[
22+
"transform-object-rest-spread",
23+
{
24+
"useBuiltIns": true
25+
}
26+
]
27+
],
28+
"env": {
29+
"test": {
30+
"presets": [
31+
"env"
32+
],
33+
"plugins": [
34+
"transform-object-rest-spread"
35+
]
36+
}
37+
}
38+
}

.editorconfig

+7-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
# editorconfig.org
22

33
[*]
4-
indent_style = tab
4+
charset = utf-8
5+
indent_style = space
56
indent_size = 2
67
end_of_line = lf
7-
charset = utf-8
8-
trim_trailing_whitespace = true
98
insert_final_newline = true
9+
trim_trailing_whitespace = true
10+
11+
[.md]
12+
insert_final_newline = false
13+
trim_trailing_whitespace = false

.eslintignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
/node_modules
2+
/dist
3+
/examples/build

.eslintrc

+6-52
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,8 @@
11
{
2-
"root": true,
3-
"plugins": ["node"],
4-
"extends": ["eslint:recommended", "plugin:node/recommended"],
5-
"env": {
6-
"node": true,
7-
"jasmine": true
8-
},
9-
"rules": {
10-
"quotes": ["error", "double"],
11-
"no-undef": "error",
12-
"no-extra-semi": "error",
13-
"semi": "error",
14-
"no-template-curly-in-string": "error",
15-
"no-caller": "error",
16-
"yoda": "error",
17-
"eqeqeq": "error",
18-
"global-require": "off",
19-
"brace-style": "error",
20-
"eol-last": "error",
21-
"indent": ["error", "tab", { "SwitchCase": 1 }],
22-
"no-extra-bind": "warn",
23-
"no-empty": "off",
24-
"no-multiple-empty-lines": "error",
25-
"no-multi-spaces": "error",
26-
"no-process-exit": "warn",
27-
"space-in-parens": "error",
28-
"no-trailing-spaces": "error",
29-
"no-use-before-define": "off",
30-
"no-unused-vars": ["error", {"args": "none"}],
31-
"key-spacing": "error",
32-
"space-infix-ops": "error",
33-
"no-unsafe-negation": "error",
34-
"no-loop-func": "warn",
35-
"space-before-function-paren": ["error", "never"],
36-
"space-before-blocks": "error",
37-
"object-curly-spacing": ["error", "always"],
38-
"keyword-spacing": ["error", {
39-
"after": false,
40-
"overrides": {
41-
"try": {"after": true},
42-
"else": {"after": true},
43-
"throw": {"after": true},
44-
"case": {"after": true},
45-
"return": {"after": true},
46-
"finally": {"after": true},
47-
"do": {"after": true}
48-
}
49-
}],
50-
"node/no-unpublished-require": 0,
51-
"no-console": "off",
52-
"valid-jsdoc": "error"
53-
}
2+
"extends": "webpack",
3+
"rules": {
4+
"no-param-reassign": 0,
5+
"no-undefined": 0,
6+
"no-underscore-dangle": 0
7+
}
548
}

.gitattributes

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
yarn.lock -diff
2+
* text=auto
3+
bin/* eol=lf
4+
package-lock.json -diff

.github/ISSUE_TEMPLATE.md

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<!--
2+
1. Check the version of package you are using. If it's not the newest version, update and try again (see changelog while updating!).
3+
2. If the issue is still there, write a minimal project showing the problem and expected output.
4+
3. Link to the project and mention Node version and OS in your report.
5+
6+
**IMPORTANT! You should use [Stack Overflow](https://stackoverflow.com/) for support related questions.**
7+
-->

.github/PULL_REQUEST_TEMPLATE.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<!--
2+
1. [Read and sign the CLA](https://cla.js.foundation/webpack/webpack.js.org). This needs to be done only once. PRs that haven't signed it won't be accepted.
3+
2. Check out the [development guide](https://webpack.js.org/development/) for the API and development guidelines.
4+
3. Read through the PR diff carefully as sometimes this can reveal issues. The work will be reviewed, but this can save some effort.
5+
-->

.gitignore

+15
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,18 @@ coverage/
55
*.log
66
.eslintcache
77

8+
9+
logs
10+
npm-debug.log*
11+
yarn-debug.log*
12+
/coverage
13+
/dist
14+
/local
15+
/reports
16+
/node_modules
17+
.DS_Store
18+
Thumbs.db
19+
.idea
20+
.vscode
21+
*.sublime-project
22+
*.sublime-workspace

.travis.yml

+31-7
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,34 @@
1+
sudo: false
12
language: node_js
2-
node_js:
3-
- "4"
4-
- "5"
5-
- "6"
3+
branches:
4+
only:
5+
- master
6+
matrix:
7+
fast_finish: true
8+
include:
9+
- os: linux
10+
node_js: '8'
11+
env: WEBPACK_VERSION="2.6.0" JOB_PART=lint
12+
- os: linux
13+
node_js: '4.3'
14+
env: WEBPACK_VERSION="2.6.0" JOB_PART=test
15+
- os: linux
16+
node_js: '6'
17+
env: WEBPACK_VERSION="2.6.0" JOB_PART=test
18+
- os: linux
19+
node_js: '8'
20+
env: WEBPACK_VERSION="2.6.0" JOB_PART=coverage
21+
before_install:
22+
- 'if [[ `npm -v` != 5* ]]; then npm i -g npm@^5.0.0; fi'
23+
- nvm --version
24+
- node --version
25+
- npm --version
26+
before_script:
27+
- |-
28+
if [ "$WEBPACK_VERSION" ]; then
29+
npm i --no-save webpack@^$WEBPACK_VERSION
30+
fi
631
script:
7-
- npm run build
8-
- npm run test:all
32+
- 'npm run travis:$JOB_PART'
933
after_success:
10-
- bash <(curl -s https://codecov.io/bash)
34+
- 'bash <(curl -s https://codecov.io/bash)'

__tests__/test-uglify.js

-8
This file was deleted.

examples/another/component.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
export default function() {
2-
var element = document.createElement("h1");
1+
export default function () {
2+
const element = document.createElement('h1');
33

4-
element.className = "demo-table";
5-
element.innerHTML = "Hello world Again";
4+
element.className = 'demo-table';
5+
element.innerHTML = 'Hello world Again';
66

7-
return element;
7+
return element;
88
}

examples/another/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
import component from "./component";
1+
import component from './component';
22

33
document.body.appendChild(component());

examples/app/component.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
export default function() {
2-
var element = document.createElement("h1");
1+
export default function () {
2+
const element = document.createElement('h1');
33

4-
element.className = "demo-button";
5-
element.innerHTML = "Hello world";
4+
element.className = 'demo-button';
5+
element.innerHTML = 'Hello world';
66

7-
return element;
7+
return element;
88
}

examples/app/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
import component from "./component";
1+
import component from './component';
22

33
document.body.appendChild(component());

examples/webpack.config.js

+31-32
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,36 @@
1-
var path = require("path");
1+
const path = require('path');
2+
const UglifyJSPlugin = require('../');
23

3-
var UglifyJSPlugin = require("../src");
4-
5-
var PATHS = {
6-
app: path.join(__dirname, "app"),
7-
another: path.join(__dirname, "another"),
8-
build: path.join(__dirname, "build")
4+
const PATHS = {
5+
app: path.join(__dirname, 'app'),
6+
another: path.join(__dirname, 'another'),
7+
build: path.join(__dirname, 'build'),
98
};
109

1110
module.exports = [
12-
{
13-
entry: {
14-
app: PATHS.app
15-
},
16-
output: {
17-
path: path.join(PATHS.build, "first"),
18-
filename: "[name].js"
19-
},
20-
plugins: [
21-
new UglifyJSPlugin()
22-
]
23-
},
24-
{
25-
entry: {
26-
first: PATHS.app,
27-
second: PATHS.another
28-
},
29-
output: {
30-
path: path.join(PATHS.build, "second"),
31-
filename: "[name].js"
32-
},
33-
plugins: [
34-
new UglifyJSPlugin()
35-
]
36-
}
11+
{
12+
entry: {
13+
app: PATHS.app,
14+
},
15+
output: {
16+
path: path.join(PATHS.build, 'first'),
17+
filename: '[name].js',
18+
},
19+
plugins: [
20+
new UglifyJSPlugin(),
21+
],
22+
},
23+
{
24+
entry: {
25+
first: PATHS.app,
26+
second: PATHS.another,
27+
},
28+
output: {
29+
path: path.join(PATHS.build, 'second'),
30+
filename: '[name].js',
31+
},
32+
plugins: [
33+
new UglifyJSPlugin(),
34+
],
35+
},
3736
];

examples/webpack.parts.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
var UglifyJSPlugin = require("../src");
1+
const UglifyJSPlugin = require('../src');
22

33
exports.minifyJS = function minifyJS(options) {
4-
return {
5-
plugins: [
6-
new UglifyJSPlugin(options)
7-
]
8-
};
4+
return {
5+
plugins: [
6+
new UglifyJSPlugin(options),
7+
],
8+
};
99
};

0 commit comments

Comments
 (0)