Skip to content

Commit

Permalink
adding a cjs build
Browse files Browse the repository at this point in the history
  • Loading branch information
cadgerfeast committed Sep 20, 2019
1 parent efaf929 commit ad467c0
Show file tree
Hide file tree
Showing 12 changed files with 3,368 additions and 3,171 deletions.
12 changes: 12 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"presets": [
[
"@babel/preset-env",
{
"targets": {
"node": "current"
}
}
]
]
}
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ module.exports = {
},
env: {
browser: true,
jest: true
},
extends: 'standard',
plugins: [
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ import VueKonami from 'vue-konami'
Vue.use(VueKonami)
```

Alternativelly you can reference the script in your HTML:
Alternatively you can reference the script in your HTML:

``` html
<script src="path/to/vue-konami.min.js"></script>
<script src="path/to/vue-konami.umd.js"></script>
<!-- CDN -->
<script src="https://unpkg.com/vue-konami"></script>
<script src="https://unpkg.com/vue-konami/dist/vue-konami.umd.js"></script>
```

## Usage
Expand Down
12 changes: 0 additions & 12 deletions babel.config.js

This file was deleted.

17 changes: 15 additions & 2 deletions config/webpack.config.base.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const path = require('path')
const webpack = require('webpack')
const UglifyJsPlugin = require('uglifyjs-webpack-plugin')

const config = require('../package.json')

Expand All @@ -8,7 +9,6 @@ function resolve (dir) {
}

module.exports = {
entry: './src/index.js',
resolve: {
extensions: ['.js', '.vue', '.json'],
alias: {
Expand All @@ -34,5 +34,18 @@ module.exports = {
new webpack.DefinePlugin({
'VERSION': JSON.stringify(config.version)
})
]
],
optimization: {
minimizer: [
new UglifyJsPlugin({
cache: true,
parallel: true,
uglifyOptions: {
compress: false,
ecma: 6,
mangle: true
}
})
]
}
}
14 changes: 14 additions & 0 deletions config/webpack.config.cjs.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
const merge = require('webpack-merge')
const base = require('./webpack.config.base')
const path = require('path')

module.exports = merge(base, {
mode: 'production',
entry: './src/cjs.js',
output: {
path: path.resolve(__dirname, '../dist'),
filename: 'vue-konami.cjs.js',
library: 'VueKonami',
libraryTarget: 'commonjs'
}
})
30 changes: 0 additions & 30 deletions config/webpack.config.min.js

This file was deleted.

14 changes: 14 additions & 0 deletions config/webpack.config.umd.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
const merge = require('webpack-merge')
const base = require('./webpack.config.base')
const path = require('path')

module.exports = merge(base, {
mode: 'production',
entry: './src/umd.js',
output: {
path: path.resolve(__dirname, '../dist'),
filename: 'vue-konami.umd.js',
library: 'VueKonami',
libraryTarget: 'umd'
}
})
Loading

0 comments on commit ad467c0

Please sign in to comment.