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

Commit

Permalink
chore: Update to webpack-defaults
Browse files Browse the repository at this point in the history
Closes #24.
  • Loading branch information
bebraw committed May 27, 2017
1 parent 6eee9be commit a22daf7
Show file tree
Hide file tree
Showing 20 changed files with 5,511 additions and 356 deletions.
37 changes: 33 additions & 4 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,9 +1,38 @@
{
"presets": [
"es2015"
"es2015",
[
"env",
{
"useBuiltIns": true,
"targets": {
"node": "4.3"
},
"exclude": [
"transform-async-to-generator",
"transform-regenerator"
]
}
]
],
"plugins": [
"syntax-object-rest-spread",
"transform-object-rest-spread"
]
}
"transform-object-rest-spread",
[
"transform-object-rest-spread",
{
"useBuiltIns": true
}
]
],
"env": {
"test": {
"presets": [
"env"
],
"plugins": [
"transform-object-rest-spread"
]
}
}
}
10 changes: 7 additions & 3 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
# editorconfig.org

[*]
indent_style = tab
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
trim_trailing_whitespace = true

[.md]
insert_final_newline = false
trim_trailing_whitespace = false
3 changes: 3 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/node_modules
/dist
/examples/build
58 changes: 6 additions & 52 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,54 +1,8 @@
{
"root": true,
"plugins": ["node"],
"extends": ["eslint:recommended", "plugin:node/recommended"],
"env": {
"node": true,
"jasmine": true
},
"rules": {
"quotes": ["error", "double"],
"no-undef": "error",
"no-extra-semi": "error",
"semi": "error",
"no-template-curly-in-string": "error",
"no-caller": "error",
"yoda": "error",
"eqeqeq": "error",
"global-require": "off",
"brace-style": "error",
"eol-last": "error",
"indent": ["error", "tab", { "SwitchCase": 1 }],
"no-extra-bind": "warn",
"no-empty": "off",
"no-multiple-empty-lines": "error",
"no-multi-spaces": "error",
"no-process-exit": "warn",
"space-in-parens": "error",
"no-trailing-spaces": "error",
"no-use-before-define": "off",
"no-unused-vars": ["error", {"args": "none"}],
"key-spacing": "error",
"space-infix-ops": "error",
"no-unsafe-negation": "error",
"no-loop-func": "warn",
"space-before-function-paren": ["error", "never"],
"space-before-blocks": "error",
"object-curly-spacing": ["error", "always"],
"keyword-spacing": ["error", {
"after": false,
"overrides": {
"try": {"after": true},
"else": {"after": true},
"throw": {"after": true},
"case": {"after": true},
"return": {"after": true},
"finally": {"after": true},
"do": {"after": true}
}
}],
"node/no-unpublished-require": 0,
"no-console": "off",
"valid-jsdoc": "error"
}
"extends": "webpack",
"rules": {
"no-param-reassign": 0,
"no-undefined": 0,
"no-underscore-dangle": 0
}
}
3 changes: 3 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
yarn.lock -diff
* text=auto
bin/* eol=lf
7 changes: 7 additions & 0 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<!--
1. Check the version of package you are using. If it's not the newest version, update and try again (see changelog while updating!).
2. If the issue is still there, write a minimal project showing the problem and expected output.
3. Link to the project and mention Node version and OS in your report.
**IMPORTANT! You should use [Stack Overflow](https://stackoverflow.com/) for support related questions.**
-->
5 changes: 5 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<!--
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.
2. Check out the [development guide](https://webpack.js.org/development/) for the API and development guidelines.
3. Read through the PR diff carefully as sometimes this can reveal issues. The work will be reviewed, but this can save some effort.
-->
15 changes: 15 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,18 @@ coverage/
*.log
.eslintcache


logs
npm-debug.log*
yarn-debug.log*
/coverage
/dist
/local
/reports
/node_modules
.DS_Store
Thumbs.db
.idea
.vscode
*.sublime-project
*.sublime-workspace
36 changes: 29 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,32 @@
sudo: false
language: node_js
node_js:
- "4"
- "5"
- "6"
branches:
only:
- master
matrix:
fast_finish: true
include:
- os: linux
node_js: '7'
env: WEBPACK_VERSION="2.2.0" JOB_PART=lint
- os: linux
node_js: '4.3'
env: WEBPACK_VERSION="2.2.0" JOB_PART=test
- os: linux
node_js: '6'
env: WEBPACK_VERSION="2.2.0" JOB_PART=test
- os: linux
node_js: '7'
env: WEBPACK_VERSION="2.2.0" JOB_PART=coverage
before_install:
- nvm --version
- node --version
before_script:
- |-
if [ "$WEBPACK_VERSION" ]; then
yarn add webpack@^$WEBPACK_VERSION
fi
script:
- npm run build
- npm run test:all
- 'yarn run travis:$JOB_PART'
after_success:
- bash <(curl -s https://codecov.io/bash)
- 'bash <(curl -s https://codecov.io/bash)'
8 changes: 0 additions & 8 deletions __tests__/test-uglify.js

This file was deleted.

10 changes: 5 additions & 5 deletions examples/another/component.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
export default function() {
var element = document.createElement("h1");
export default function () {
const element = document.createElement('h1');

element.className = "demo-table";
element.innerHTML = "Hello world Again";
element.className = 'demo-table';
element.innerHTML = 'Hello world Again';

return element;
return element;
}
2 changes: 1 addition & 1 deletion examples/another/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import component from "./component";
import component from './component';

document.body.appendChild(component());
10 changes: 5 additions & 5 deletions examples/app/component.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
export default function() {
var element = document.createElement("h1");
export default function () {
const element = document.createElement('h1');

element.className = "demo-button";
element.innerHTML = "Hello world";
element.className = 'demo-button';
element.innerHTML = 'Hello world';

return element;
return element;
}
2 changes: 1 addition & 1 deletion examples/app/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import component from "./component";
import component from './component';

document.body.appendChild(component());
63 changes: 31 additions & 32 deletions examples/webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,37 +1,36 @@
var path = require("path");
const path = require('path');
const UglifyJSPlugin = require('../');

var UglifyJSPlugin = require("../src");

var PATHS = {
app: path.join(__dirname, "app"),
another: path.join(__dirname, "another"),
build: path.join(__dirname, "build")
const PATHS = {
app: path.join(__dirname, 'app'),
another: path.join(__dirname, 'another'),
build: path.join(__dirname, 'build'),
};

module.exports = [
{
entry: {
app: PATHS.app
},
output: {
path: path.join(PATHS.build, "first"),
filename: "[name].js"
},
plugins: [
new UglifyJSPlugin()
]
},
{
entry: {
first: PATHS.app,
second: PATHS.another
},
output: {
path: path.join(PATHS.build, "second"),
filename: "[name].js"
},
plugins: [
new UglifyJSPlugin()
]
}
{
entry: {
app: PATHS.app,
},
output: {
path: path.join(PATHS.build, 'first'),
filename: '[name].js',
},
plugins: [
new UglifyJSPlugin(),
],
},
{
entry: {
first: PATHS.app,
second: PATHS.another,
},
output: {
path: path.join(PATHS.build, 'second'),
filename: '[name].js',
},
plugins: [
new UglifyJSPlugin(),
],
},
];
12 changes: 6 additions & 6 deletions examples/webpack.parts.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
var UglifyJSPlugin = require("../src");
const UglifyJSPlugin = require('../src');

exports.minifyJS = function minifyJS(options) {
return {
plugins: [
new UglifyJSPlugin(options)
]
};
return {
plugins: [
new UglifyJSPlugin(options),
],
};
};
Loading

0 comments on commit a22daf7

Please sign in to comment.