Skip to content

Commit

Permalink
Use webpack
Browse files Browse the repository at this point in the history
  • Loading branch information
tylerlong committed Dec 18, 2017
1 parent 6f10705 commit 45c2f99
Show file tree
Hide file tree
Showing 8 changed files with 1,733 additions and 49 deletions.
3 changes: 2 additions & 1 deletion .ackrc
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
--ignore-file=match:/^yarn\.lock/
--ignore-file=match:/^yarn\.lock$/
--ignore-dir=dist
11 changes: 2 additions & 9 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
{
"presets": [
[
"env",
{
"targets": {
"node": "current"
}
}
]
"env"
]
}
}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
node_modules/
dist/
21 changes: 19 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ yarn install markdown-it-chart

## Usage

```JavaScript
```js
import markdownIt from 'markdown-it'
import markdownItChart from 'markdown-it-chart'
const mdi = markdownIt()
Expand Down Expand Up @@ -52,8 +52,25 @@ mdi.render(`\`\`\`chart
```


## Test
## Development

### Build

```
yarn build:watch
```

### Test

```
yarn test
```

### Distribution

```
yarn release && npm publish
```


## Todo
8 changes: 7 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@
"name": "markdown-it-chart",
"version": "0.2.0",
"description": "Chart.js plugin for markdown-it.",
"main": "src/index.js",
"main": "dist/index.js",
"scripts": {
"build": "webpack --progress --color",
"build:watch": "yarn build --watch",
"release": "yarn build -p",
"test": "node -r babel-register test/index.js",
"upgrade": "yarn-upgrade-all"
},
Expand All @@ -12,9 +15,12 @@
"license": "MIT",
"devDependencies": {
"babel-core": "^6.26.0",
"babel-loader": "^7.1.2",
"babel-preset-env": "^1.6.1",
"markdown-it": "^8.4.0",
"standard": "^10.0.3",
"webpack": "^3.10.0",
"webpack-node-externals": "^1.6.0",
"yarn-upgrade-all": "^0.2.0"
}
}
2 changes: 1 addition & 1 deletion test/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import assert from 'assert'
import markdownIt from 'markdown-it'
import markdownItChart from '../src/index'
import markdownItChart from '../dist/index'

const mdi = markdownIt()
mdi.use(markdownItChart)
Expand Down
34 changes: 34 additions & 0 deletions webpack.config.babel.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import path from 'path'
import nodeExternals from 'webpack-node-externals'

const config = {
target: 'node',
entry: {
index: './src/index.js'
},
externals: [nodeExternals()],
output: {
path: path.join(__dirname, 'dist'),
filename: '[name].js',
libraryTarget: 'commonjs2'
},
module: {
rules: [
{
test: /\.js$/,
exclude: /node_modules/,
use: {
loader: 'babel-loader',
options: {
presets: [
'env'
]
}
}
}
]
},
devtool: 'source-map'
}

export default config
Loading

0 comments on commit 45c2f99

Please sign in to comment.