Skip to content

Commit

Permalink
Merge pull request #238 from primer/path-alias
Browse files Browse the repository at this point in the history
Make static assets available on path alias
  • Loading branch information
shawnbot authored Sep 11, 2018
2 parents 6002501 + 4059955 commit 842ac5b
Show file tree
Hide file tree
Showing 16 changed files with 7,217 additions and 4,605 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
.*.swp
.DS_Store
*.log
*.tgz
.next/
.test/
coverage/
Expand Down
8 changes: 0 additions & 8 deletions .npmignore

This file was deleted.

6 changes: 2 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@ cache:
# cache jest intermediary files between builds
- $(jq -r .jest.cacheDirectory package.json)

# XXX remove this after merging
before_script:
- npm i fs-extra

script:
- npm run lint
# see <https://github.com/facebook/jest/issues/3855> for more info
Expand All @@ -19,6 +15,8 @@ script:
- npm run dist
# make sure we can build the site
- npm run build
# make sure that the package includes and excludes all the right stuff
- npm pack

notifications:
slack: github:4OisIoqZYyMlWcw3hFtZgbmh
8 changes: 8 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module.exports = {
cacheDirectory: '.test',
collectCoverage: true,
collectCoverageFrom: [
'src/*.js'
],
setupTestFrameworkScriptFile: '<rootDir>/src/utils/test-matchers.js'
}
19 changes: 14 additions & 5 deletions next.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
const withMDX = require('@zeit/next-mdx')({
extension: /\.(md|mdx)?$/
})
const withPlugins = require('next-compose-plugins')
const sass = require('@zeit/next-sass')
const mdx = require('@zeit/next-mdx')({extension: /\.mdx?$/})

module.exports = withMDX({
pageExtensions: ['js', 'jsx', 'md', 'mdx']
module.exports = withPlugins([sass, mdx], {
/*
* Note: Prefixing assets with the fully qualified deployment URL
* makes them available even when the site is served from a path alias, as in
* <https://primer.style/components>
*/
assetPrefix: process.env.NOW_URL,
pageExtensions: ['js', 'jsx', 'md', 'mdx'],
sassLoaderOptions: {
includePaths: ['node_modules']
}
})
5 changes: 2 additions & 3 deletions now.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
{
"alias": "primer-react.now.sh",
"files": [
"next.config.js",
"pages",
"rollup.config.js",
"src",
"next.config.js"
"src"
]
}
Loading

0 comments on commit 842ac5b

Please sign in to comment.