generated from atomicpages/ts-starter
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e502d18
commit 5b230d0
Showing
7 changed files
with
6,596 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
on: [push, pull_request] | ||
name: Build PR & Push | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
node-version: [12.x, 14.x] | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
- name: npm install, lint, and build | ||
run: | | ||
npm i | ||
npm run lint | ||
npm run build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
name: Release | ||
on: | ||
release: | ||
types: [released] | ||
jobs: | ||
publish: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- uses: actions/setup-node@v1 | ||
with: | ||
node-version: 12 | ||
registry-url: https://registry.npmjs.org/ | ||
- name: npm install | ||
run: | | ||
npm i | ||
npm run build | ||
- name: publish | ||
run: npm publish pkg/ | ||
env: | ||
NODE_AUTH_TOKEN: ${{secrets.npm_token}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -102,3 +102,6 @@ dist | |
|
||
# TernJS port file | ||
.tern-port | ||
|
||
# Pika builds | ||
pkg/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,47 @@ | ||
# My Typescript Template | ||
# Docusaurus Plugin Module Alias | ||
|
||
A small template that I use to build node typescript-based projects. | ||
A small Docusaurus 2.x plugin that simplifies the addition of module aliases. | ||
|
||
## Stack | ||
## Installation | ||
|
||
* `typescript` | ||
* `@pika/pack` | ||
* `eslint` | ||
* `prettier` | ||
```sh | ||
npm i --save-dev docusaurus-plugin-module-alias # or | ||
yarn add docusaurus-plugin-module-alias --dev | ||
``` | ||
|
||
## Why? | ||
|
||
Docusaurus 2.x uses webpack to build SSR and client bundles. Creating a plugin to add a module alias for every new docusaurus site can be easily modularized. | ||
|
||
## Usage | ||
|
||
Inside your `docusaurus.config.js` add to the `plugins` field and configure with the `alias` option :+1: | ||
|
||
```js | ||
const path = require('path'); | ||
|
||
module.exports = { | ||
// ... | ||
plugins: [ | ||
[ | ||
'docusaurus-plugin-module-alias', | ||
{ | ||
alias: { | ||
'@local/component': path.resolve(__dirname, '../src/index.js'), | ||
}, | ||
}, | ||
], | ||
], | ||
}; | ||
``` | ||
|
||
### Invalid Aliases | ||
|
||
Docusaurus has special aliases that shouldn't be overridden: `@site`, `@generated`, `@docusaurus`, `~docs`, `~blog`, `~pages`, `~debug` | ||
|
||
## Options | ||
|
||
| Name | Type | Required | Description | | ||
| --------------- | ------------------------ | -------- | -------------------------------------------------------------------- | | ||
| `alias` | `Record<string, string>` | Yes | Aliases passes to webpack | | ||
| `mergeStrategy` | `Record<string, string>` | No | Change the merge strategy used by `webpack-merge`. Use with caution! | |
Oops, something went wrong.