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

Test that demonstrates hanging issue with broken imports #389

Open
wants to merge 17 commits into
base: v11
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,43 @@ The previous configuration will expect and build the files:
- `src/index.html` => `dist/index.html`
- `src/index.js` => `dist/index.js`

#### Excluding a page from chunks

If you want a page to be excluded from either the [vendor](#chunksvendor) or [common](#chunkscommon) chunk, then you can do so by providing an object with a `name` and `independent` flag (set to `true`) instead of just the name of the page.

```js
// sagui.config.js
module.exports = {
pages: ['index', 'about', { name: 'demo', independent: true }]
}
```

### `chunks.vendor`

If you want all your external dependencies (`node_modules`) in your [pages](#pages) to be bundled together in a "vendor" chunk, then set this flag to `true`. By default it is set to `false`.

```js
// sagui.config.js
module.exports = {
chunks: {
vendor: true
}
}
```

### `chunks.common`

If you do not want all the common dependencies of your [pages](#pages) to be bundled together in a "common" chunk, then set this flag to `false`. By default it is set to `true`.

```js
// sagui.config.js
module.exports = {
chunks: {
common: false
}
}
```

### `libraries`

Create **reusable libraries** that can be shared across applications. Sagui will take care of the build process so that external libraries are not bundled and that you have a CommonJS module as the output.
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sagui",
"version": "11.4.2",
"version": "11.5.0",
"description": "Front-end tooling in a single dependency",
"preferGlobal": false,
"bin": {
Expand Down Expand Up @@ -111,6 +111,7 @@
"karma-phantomjs-launcher": "^1.0.4",
"karma-sourcemap-loader": "^0.3.7",
"karma-webpack": "^2.0.3",
"lodash.merge": "^4.6.0",
"lodash.uniq": "^4.5.0",
"node-sass": "^4.5.2",
"null-loader": "^0.1.1",
Expand All @@ -125,7 +126,7 @@
"url-loader": "^0.5.8",
"webpack": "^3.2.0",
"webpack-dev-server": "^2.5.1",
"webpack-md5-hash": "0.0.5",
"webpack-md5-hash": "0.0.6",
"webpack-merge": "^4.1.0",
"yaml-loader": "^0.5.0"
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import('name-that-is-invalid')

describe('my project', function() {
it('should work not work at all', function() {})
})
Binary file not shown.
Binary file not shown.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions spec/fixtures/project-with-independent-page/sagui.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module.exports = {
pages: ['index', 'about', { name: 'demo', independent: true }],
chunks: {
vendor: true,
common: true,
}
}
11 changes: 11 additions & 0 deletions spec/fixtures/project-with-independent-page/src/about.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html>
<head>
<title>Hello</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
</head>
<body>
<div id="root"></div>
</body>
</html>
5 changes: 5 additions & 0 deletions spec/fixtures/project-with-independent-page/src/about.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import shared from './shared'
import dependencyA from 'dependencyA'

shared()
dependencyA()
11 changes: 11 additions & 0 deletions spec/fixtures/project-with-independent-page/src/demo.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html>
<head>
<title>Hello</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
</head>
<body>
<div id="root"></div>
</body>
</html>
7 changes: 7 additions & 0 deletions spec/fixtures/project-with-independent-page/src/demo.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import shared from './shared'
import dependencyA from 'dependencyA'
import dependencyB from 'dependencyB'

shared()
dependencyA()
dependencyB()
11 changes: 11 additions & 0 deletions spec/fixtures/project-with-independent-page/src/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html>
<head>
<title>Hello</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
</head>
<body>
<div id="root"></div>
</body>
</html>
5 changes: 5 additions & 0 deletions spec/fixtures/project-with-independent-page/src/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import shared from './shared'
import dependencyB from 'dependencyB'

shared()
dependencyB()
1 change: 1 addition & 0 deletions spec/fixtures/project-with-independent-page/src/shared.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export default () => console.log('shared module')
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
pages: ['index', 'about'],
chunks: {
common: false
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html>
<head>
<title>Hello</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
</head>
<body>
<div id="root"></div>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import shared from './shared'

shared()
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html>
<head>
<title>Hello</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
</head>
<body>
<div id="root"></div>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import shared from './shared'

shared()
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export default () => console.log('shared module')
Binary file not shown.
Binary file not shown.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
pages: ['index', 'about'],
chunks: {
vendor: true
}
}
11 changes: 11 additions & 0 deletions spec/fixtures/project-with-two-pages-enabled-vendor/src/about.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html>
<head>
<title>Hello</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
</head>
<body>
<div id="root"></div>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import shared from './shared'
import dependencyA from 'dependencyA'

shared()
dependencyA()
11 changes: 11 additions & 0 deletions spec/fixtures/project-with-two-pages-enabled-vendor/src/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html>
<head>
<title>Hello</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
</head>
<body>
<div id="root"></div>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import shared from './shared'
import dependencyB from 'dependencyB'

shared()
dependencyB()
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export default () => console.log('shared module')
3 changes: 3 additions & 0 deletions spec/fixtures/project-with-two-pages/sagui.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
pages: ['index', 'about']
}
11 changes: 11 additions & 0 deletions spec/fixtures/project-with-two-pages/src/about.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html>
<head>
<title>Hello</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
</head>
<body>
<div id="root"></div>
</body>
</html>
3 changes: 3 additions & 0 deletions spec/fixtures/project-with-two-pages/src/about.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import shared from './shared'

shared()
11 changes: 11 additions & 0 deletions spec/fixtures/project-with-two-pages/src/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html>
<head>
<title>Hello</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
</head>
<body>
<div id="root"></div>
</body>
</html>
3 changes: 3 additions & 0 deletions spec/fixtures/project-with-two-pages/src/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import shared from './shared'

shared()
1 change: 1 addition & 0 deletions spec/fixtures/project-with-two-pages/src/shared.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export default () => console.log('shared module')
Loading