Skip to content
This repository has been archived by the owner on Mar 17, 2021. It is now read-only.

Commit

Permalink
refactor: next (#198)
Browse files Browse the repository at this point in the history
  • Loading branch information
evilebottnawi committed Nov 26, 2019
1 parent 2451157 commit 3f0bbc5
Show file tree
Hide file tree
Showing 38 changed files with 1,819 additions and 1,389 deletions.
1 change: 0 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,4 @@ insert_final_newline = true
trim_trailing_whitespace = true

[*.md]
insert_final_newline = true
trim_trailing_whitespace = false
32 changes: 32 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,38 @@ module.exports = {
};
```

### `esModule`

Type: `Boolean`
Default: `true`

By default, `file-loader` generates JS modules that use the ES modules syntax.
There are some cases in which using ES modules is beneficial, like in the case of [module concatenation](https://webpack.js.org/plugins/module-concatenation-plugin/) and [tree shaking](https://webpack.js.org/guides/tree-shaking/).

You can enable a CommonJS module syntax using:

**webpack.config.js**

```js
module.exports = {
module: {
rules: [
{
test: /\.css$/,
use: [
{
loader: 'url-loader',
options: {
esModule: false,
},
},
],
},
],
},
};
```

## Contributing

Please take a moment to read our contributing guidelines if you haven't yet done so.
Expand Down
76 changes: 42 additions & 34 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@ trigger:
- master
- next

variables:
npm_config_cache: $(Pipeline.Workspace)/.npm

jobs:
- job: Lint
pool:
vmImage: ubuntu-16.04
vmImage: ubuntu-latest
steps:
- task: NodeTool@0
inputs:
Expand All @@ -20,10 +23,12 @@ jobs:
node -v
npm -v
displayName: 'Print versions'
- task: Npm@1
- task: CacheBeta@1
inputs:
command: custom
customCommand: ci
key: npm | $(Agent.OS) | package-lock.json
path: $(npm_config_cache)
displayName: 'Cache npm'
- script: npm ci
displayName: 'Install dependencies'
- script: npm run lint
displayName: 'Run lint'
Expand All @@ -34,23 +39,22 @@ jobs:

- job: Linux
pool:
vmImage: ubuntu-16.04
vmImage: ubuntu-latest
strategy:
maxParallel: 4
matrix:
node-13:
node_version: ^13.0.0
webpack_version: latest
node-12:
node_version: ^12.0.0
webpack_version: latest
node-10:
node_version: ^10.13.0
webpack_version: latest
node-8:
node_version: ^8.9.0
webpack_version: latest
node-8-canary:
node_version: ^8.9.0
node-10-canary:
node_version: ^10.13.0
webpack_version: next
continue_on_error: true
steps:
- task: NodeTool@0
inputs:
Expand All @@ -65,10 +69,12 @@ jobs:
node -v
npm -v
displayName: 'Print versions'
- task: Npm@1
- task: CacheBeta@1
inputs:
command: custom
customCommand: ci
key: npm | $(Agent.OS) | package-lock.json
path: $(npm_config_cache)
displayName: 'Cache npm'
- script: npm ci
displayName: 'Install dependencies'
- script: npm i webpack@$(webpack_version)
displayName: 'Install "webpack@$(webpack_version)"'
Expand All @@ -86,23 +92,22 @@ jobs:

- job: macOS
pool:
vmImage: macOS-10.14
vmImage: macOS-latest
strategy:
maxParallel: 4
matrix:
node-13:
node_version: ^13.0.0
webpack_version: latest
node-12:
node_version: ^12.0.0
webpack_version: latest
node-10:
node_version: ^10.13.0
webpack_version: latest
node-8:
node_version: ^8.9.0
webpack_version: latest
node-8-canary:
node_version: ^8.9.0
node-10-canary:
node_version: ^10.13.0
webpack_version: next
continue_on_error: true
steps:
- task: NodeTool@0
inputs:
Expand All @@ -117,10 +122,12 @@ jobs:
node -v
npm -v
displayName: 'Print versions'
- task: Npm@1
- task: CacheBeta@1
inputs:
command: custom
customCommand: ci
key: npm | $(Agent.OS) | package-lock.json
path: $(npm_config_cache)
displayName: 'Cache npm'
- script: npm ci
displayName: 'Install dependencies'
- script: npm i webpack@$(webpack_version)
displayName: 'Install "webpack@$(webpack_version)"'
Expand All @@ -138,23 +145,22 @@ jobs:

- job: Windows
pool:
vmImage: windows-2019
vmImage: windows-latest
strategy:
maxParallel: 4
matrix:
node-13:
node_version: ^13.0.0
webpack_version: latest
node-12:
node_version: ^12.0.0
webpack_version: latest
node-10:
node_version: ^10.13.0
webpack_version: latest
node-8:
node_version: ^8.9.0
webpack_version: latest
node-8-canary:
node_version: ^8.9.0
node-10-canary:
node_version: ^10.13.0
webpack_version: next
continue_on_error: true
steps:
- script: 'git config --global core.autocrlf input'
displayName: 'Config git core.autocrlf'
Expand All @@ -172,10 +178,12 @@ jobs:
node -v
npm -v
displayName: 'Print versions'
- task: Npm@1
- task: CacheBeta@1
inputs:
command: custom
customCommand: ci
key: npm | $(Agent.OS) | package-lock.json
path: $(npm_config_cache)
displayName: 'Cache npm'
- script: npm ci
displayName: 'Install dependencies'
- script: npm i webpack@$(webpack_version)
displayName: 'Install "webpack@$(webpack_version)"'
Expand Down
2 changes: 1 addition & 1 deletion babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ module.exports = (api) => {
'@babel/preset-env',
{
targets: {
node: '8.9.0',
node: '10.13.0',
},
},
],
Expand Down
2 changes: 1 addition & 1 deletion lint-staged.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module.exports = {
'*.js': ['prettier --write', 'eslint --fix', 'git add'],
'*.{json,md,yml,css}': ['prettier --write', 'git add'],
'*.{json,md,yml,css,ts}': ['prettier --write', 'git add'],
};

0 comments on commit 3f0bbc5

Please sign in to comment.