Skip to content

Commit d70df14

Browse files
committed
Updated with latest Mix
1 parent bd673d6 commit d70df14

File tree

140 files changed

+2766
-17979
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

140 files changed

+2766
-17979
lines changed

.appveyor.yml

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,28 @@
11
# Test against all supported versions of Node.js on windows
22
environment:
3-
matrix:
4-
- nodejs_version: "6"
5-
- nodejs_version: "7"
6-
- nodejs_version: "8"
7-
- nodejs_version: "9"
3+
matrix:
4+
- nodejs_version: '8'
5+
- nodejs_version: '9'
6+
- nodejs_version: '10'
87

98
cache:
10-
- node_modules
11-
- "%LOCALAPPDATA%\\Yarn"
9+
- node_modules
10+
- '%APPDATA%\npm-cache'
1211

1312
# Install scripts. (runs after repo cloning)
1413
install:
15-
# Get the version of Node.js
16-
- ps: Install-Product node $env:nodejs_version
17-
# install modules – uses yarn to avoid the following case
18-
# npm 3.10.10, used in node 6 environment doesn't respect package.lock and thus installs other versions of packages
19-
# than later npm releases. This causes hashes to be different and thus it causes tests to fail in the
20-
# node 6 environment
21-
- yarn
14+
# Get the version of Node.js
15+
- ps: Install-Product node $env:nodejs_version
16+
- npm install --global npm@latest
17+
- npm ci
2218

2319
# Post-install test scripts.
2420
test_script:
25-
# Output useful info for debugging.
26-
- node --version
27-
- yarn --version
28-
# run tests
29-
- yarn test
21+
# Output useful info for debugging.
22+
- node --version
23+
- npm --version
24+
# run tests
25+
- npm test
3026

3127
# Don't actually build.
3228
build: off

.eslintignore

Whitespace-only changes.

.eslintrc

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"parserOptions": {
3+
"ecmaVersion": 6,
4+
"sourceType": "module"
5+
},
6+
"env": {
7+
"node": true
8+
},
9+
"rules": {
10+
"no-const-assign": "error",
11+
"newline-before-return": "error",
12+
"semi": "error",
13+
"no-unreachable": "error",
14+
"no-extra-semi": "error",
15+
"no-unexpected-multiline": "error",
16+
"comma-dangle": [
17+
"error",
18+
{
19+
"arrays": "never",
20+
"objects": "never",
21+
"imports": "never",
22+
"exports": "never",
23+
"functions": "never"
24+
}
25+
]
26+
}
27+
}

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* text=auto eol=lf

.gitignore

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
.nyc_output
2-
coverage
31
node_modules/
4-
npm-debug.log
2+
notes.md
3+
coverage
4+
.nyc_output
5+
.idea/
6+
*.log
7+
package-lock.json
8+
yarn.lock

.huskyrc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"hooks": {
3+
"pre-commit": "pretty-quick --staged"
4+
}
5+
}

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.nyc_output

.prettierrc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"endOfLine": "lf",
3+
"singleQuote": true,
4+
"tabWidth": 4,
5+
"semi": true
6+
}

.travis.yml

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,20 @@ language: node_js
22

33
# Test linux and osx
44
os:
5-
- linux
6-
- osx
5+
- linux
6+
- osx
77

88
# Test against all supported versions of Node.js
99
node_js:
10-
- "6"
11-
- "7"
12-
- "8"
13-
- "9"
10+
- '8'
11+
- '10'
12+
- '12'
13+
- '13'
14+
15+
# Run ESLint after npm test
16+
script:
17+
- npm run eslint
1418

1519
cache:
16-
directories:
17-
- "node_modules"
20+
directories:
21+
- 'node_modules'

CODE_OF_CONDUCT.md

Lines changed: 0 additions & 46 deletions
This file was deleted.

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2018 Devanand
3+
Copyright (c) 2020 Devanand
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

_config.yml

Lines changed: 0 additions & 1 deletion
This file was deleted.

docs/autoloading.md

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,13 @@
11
# Autoloading
22

3-
```js
4-
mix.autoload({
5-
jquery: ['$', 'window.jQuery']
6-
});
7-
```
8-
9-
Webpack offers the necessary facilities to make a module available as a variable in every other module required by Webpack. If you're working with a particular plugin or library that depends upon a global variable, such as jQuery, `mix.autoload()` may prove useful to you.
10-
11-
> In fact, because jQuery is such a frequent example, Webpack Mix ships with jQuery autoloading out of the box. Should you need to disable this, you may pass an empty object to `mix.autoload({})`.
3+
Webpack offers the necessary facilities to make a module available as a variable in every other module required by webpack. If you're working with a particular plugin or library that depends upon a global variable, such as jQuery, `mix.autoload()` may prove useful to you.
124

135
Consider the following example:
146

157
```js
168
mix.autoload({
17-
jquery: ['$', 'window.jQuery']
9+
jquery: ['$', 'window.jQuery']
1810
});
1911
```
2012

21-
This snippet specifies that Webpack should prepend `var $ = require('jquery')` to every location that it encounters either the global `$` identifier, or `window.jQuery`. Nifty!
13+
This snippet specifies that webpack should prepend `var $ = require('jquery')` to every location that it encounters either the global `$` identifier, or `window.jQuery`. Nifty!

docs/basic-example.md

100755100644
Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,26 @@
11
# Basic Example
22

3-
Webpack Mix is a clean layer on top of Webpack to make the 80% use case laughably simple to execute. Most would agree that, though incredibly powerful, Webpack ships with a steep learning curve. But what if you didn't have to worry about that?
3+
Webpack Mix is a clean layer on top of webpack to make the 80% use case laughably simple to execute. Most would agree that, though incredibly powerful, webpack ships with a steep learning curve. But what if you didn't have to worry about that?
44

55
Have a look at a basic `webpack.mix.js` file. Let's imagine that we only desire JavaScript \(ES2015 with modules\), and Sass compilation:
66

77
```js
8-
let mix = require('webpack-mix').mix;
8+
let mix = require('webpack-mix');
99

10-
mix.sass('src/app.sass', 'dist')
11-
.js('src/app.js', 'dist');
10+
mix.sass('src/app.sass', 'dist').js('src/app.js', 'dist');
1211
```
1312

1413
Done. Simple, right?
1514

16-
1. Compile the Sass file, `./src/app.sass`, to `./dist/app.sass`
17-
2. Bundle all JavaScript \(and any required modules\) at `./src/app.js` to `./dist/bundle.js`.
15+
1. Compile the Sass file, `./src/app.sass`, to `./dist/app.css`
16+
2. Bundle all JavaScript \(and any required modules\) at `./src/app.js` to `./dist/app.js`.
1817

19-
With this configuration in place, we may trigger Webpack from the command line: `node_modules/.bin/webpack`.
18+
With this configuration in place, we may trigger webpack from the command line: `node_modules/.bin/webpack`.
2019

21-
During development, it's unnecessary to minify the output, however, this will be performed automatically when you trigger Webpack within a production environment: `export NODE_ENV=production webpack`.
20+
During development, it's unnecessary to minify the output, however, this will be performed automatically when you trigger webpack within a production environment: `export NODE_ENV=production webpack`.
2221

2322
### Less?
2423

25-
But what if you prefer Less compilation instead? No problem. Just swap `mix.sass()` with `mix.less()`, and you're done!
26-
27-
You'll find that most common Webpack tasks become a cinch with Webpack Mix.
24+
But what if you prefer Less compilation instead? No problem. Just swap `mix.sass()` with `mix.less()`, and you're done!
2825

26+
You'll find that most common webpack tasks become a cinch with Webpack Mix.

docs/browsersync.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,11 @@ mix.browserSync('my-domain.test');
1414
// https://browsersync.io/docs/options/
1515
mix.browserSync({
1616
proxy: 'my-domain.test'
17-
})
17+
});
1818
```
1919

2020
You may pass either a string (proxy) or object (BrowserSync settings) to this method. The domain name you declare as your proxy is vital. This will proxy output from webpack Dev Server through BrowserSync.
2121

2222
Other options can be seen in the [Browsersync Documentation](https://browsersync.io/docs/options/).
2323

2424
Now, boot up the dev server (`npm run watch`), and you're all set go!
25-
26-

docs/concatenation-and-minification.md

100755100644
Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ mix.minify('src');
77
mix.minify(['src']);
88
```
99

10-
If used properly, Webpack Mix and Webpack should take care of all the necessary module bundling and minification for you. However, you may have some legacy code or vendor libraries that need to be concatenated and minified. Not a problem.
10+
If used properly, Webpack Mix and webpack should take care of all the necessary module bundling and minification for you. However, you may have some legacy code or vendor libraries that need to be concatenated and minified. Not a problem.
1111

1212
### Combine Files
1313

@@ -38,11 +38,8 @@ mix.minify(['this/one.js', 'and/this/one.js']);
3838

3939
There are a few things worth noting here:
4040

41-
1. This method will overwrite the existing file.
41+
1. This method will create a companion `*.min.ext` file. So minifying `app.js` will generate `app.min.js`.
4242
2. Once again, the minification will only take place during a production build. \(`export NODE_ENV=production`\).
4343
3. There is no need to call `mix.combine(['one.js', 'two.js'], 'merged.js').minify('merged.js');`Just stick with the single `mix.combine()` call. It'll take care of both.
4444

4545
> **Important**: Please note that minification is only available for CSS and JavaScript files. The minifier will not understand any other provided file type.
46-
47-
48-

docs/copying-files.md

100755100644
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,4 @@ From time to time, you'll want to copy one or more files, as part of your build
1313
mix.copy('node_modules/vendor/acme.txt', 'public/js/acme.txt');
1414
```
1515

16-
Upon compilation, the "acme" directory will be moved to `public/js/acme.txt`, accordingly. A common use case for this is when you wish to move a set of fonts, installed through NPM, to your public directory.
17-
16+
Upon compilation, the "acme" file will be copied to `public/js/acme.txt`, accordingly. A common use case for this is when you wish to move a set of fonts, installed through NPM, to your public directory.

0 commit comments

Comments
 (0)