-
-
Notifications
You must be signed in to change notification settings - Fork 425
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add es build to work better with bundlers
- Loading branch information
Showing
11 changed files
with
249 additions
and
45 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 |
---|---|---|
@@ -1,8 +1,7 @@ | ||
module.exports = { | ||
plugins: [ | ||
'@babel/plugin-syntax-object-rest-spread', | ||
['module:fast-async', { | ||
spec: true | ||
presets: [ | ||
['minimal', { | ||
mode: 'loose' | ||
}] | ||
] | ||
} |
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,2 +1,3 @@ | ||
node_modules | ||
dist | ||
/lib |
This file was deleted.
Oops, something went wrong.
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
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
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,9 @@ | ||
module.exports = { | ||
input: 'src', | ||
outDir: 'lib', | ||
include: '**', | ||
constants: { | ||
__DOCUTE_VERSION__: JSON.stringify(require('../package').version), | ||
__PRISM_VERSION__: JSON.stringify(require('prismjs/package').version) | ||
} | ||
} |
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 |
---|---|---|
|
@@ -2,7 +2,9 @@ | |
"name": "docute", | ||
"version": "0.0.0-managed-by-semantic-release", | ||
"scripts": { | ||
"build": "poi build --config build/poi.lib.config.js --target lib", | ||
"build:umd": "poi build --config build/poi.lib.config.js --target lib", | ||
"build:es": "sfc normalize --config build/sfc.config.js", | ||
"build": "npm run build:umd && npm run build:es", | ||
"test": "npm run lint && echo 'no tests!'", | ||
"lint": "xo", | ||
"website": "poi dev --config build/poi.website.config.js", | ||
|
@@ -27,8 +29,7 @@ | |
"devDependencies": { | ||
"@babel/plugin-syntax-object-rest-spread": "^7.0.0", | ||
"@leptosia/docute-google-analytics": "^1.0.0", | ||
"buble": "^0.19.3", | ||
"buble-loader": "^0.5.1", | ||
"babel-preset-minimal": "^0.1.1", | ||
"cz-conventional-changelog": "^2.1.0", | ||
"eslint-config-rem": "^3.0.0", | ||
"eslint-plugin-vue": "^5.0.0-beta.3", | ||
|
@@ -39,6 +40,7 @@ | |
"postcss-import": "^12.0.0", | ||
"postcss-preset-env": "^6.0.3", | ||
"semantic-release": "^15.12.0", | ||
"sfc": "^0.2.12", | ||
"webpack-node-externals": "^1.7.2", | ||
"xo": "^0.23.0" | ||
}, | ||
|
@@ -47,8 +49,10 @@ | |
"type": "git" | ||
}, | ||
"main": "dist/docute.js", | ||
"module": "lib/index.js", | ||
"files": [ | ||
"dist" | ||
"dist", | ||
"lib" | ||
], | ||
"description": "Effortlessly documentation done right.", | ||
"author": "egoist <[email protected]>", | ||
|
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,32 @@ | ||
# Use With Bundlers | ||
|
||
You don't have to use a bundler in order to use Docute, however if you want, you can! | ||
|
||
First you need to install Docute as a dependency in your project: | ||
|
||
```bash | ||
yarn add docute --dev | ||
``` | ||
|
||
Then see below for the usage with your bundler of choice. | ||
|
||
## Webpack | ||
|
||
In your entry file: | ||
|
||
```js | ||
import Docute from 'docute' | ||
|
||
new Docute({ | ||
target: '#app', | ||
// Other options | ||
}) | ||
``` | ||
|
||
You may need to use [html-webpack-plugin](https://github.com/jantimon/html-webpack-plugin) to generate an HTML file too. | ||
|
||
If you're using [Vue CLI](https://cli.vuejs.org) or [Poi](https://poi.js.org), congratulations, there's no more build configs needed. | ||
|
||
## Parcel | ||
|
||
[TODO] [PR WELCOME] |
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,32 @@ | ||
# Use With Bundlers | ||
|
||
You don't have to use a bundler in order to use Docute, however if you want, you can! | ||
|
||
First you need to install Docute as a dependency in your project: | ||
|
||
```bash | ||
yarn add docute --dev | ||
``` | ||
|
||
Then see below for the usage with your bundler of choice. | ||
|
||
## Webpack | ||
|
||
In your entry file: | ||
|
||
```js | ||
import Docute from 'docute' | ||
|
||
new Docute({ | ||
target: '#app', | ||
// Other options | ||
}) | ||
``` | ||
|
||
You may need to use [html-webpack-plugin](https://github.com/jantimon/html-webpack-plugin) to generate an HTML file too. | ||
|
||
If you're using [Vue CLI](https://cli.vuejs.org) or [Poi](https://poi.js.org), congratulations, there's no more build configs needed. | ||
|
||
## Parcel | ||
|
||
[TODO] [PR WELCOME] |
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
Oops, something went wrong.