Skip to content
This repository has been archived by the owner on Apr 5, 2022. It is now read-only.

Commit

Permalink
add setting for publishing npm
Browse files Browse the repository at this point in the history
  • Loading branch information
sin-tanaka committed May 28, 2018
1 parent 592d9d6 commit 76592b2
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 10 deletions.
2 changes: 2 additions & 0 deletions dist/vue-quagga.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions dist/vue-quagga.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/vue-quagga.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/vue-quagga.min.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "vue-quaggajs",
"description": "A Vue.js project",
"main": "index.js",
"main": "dist/vue-quagga.js",
"cdn": "dist/vue-quagga.min.js",
"version": "1.0.0",
"author": "Shintaro Tanaka <[email protected]>",
Expand Down
5 changes: 5 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import QuaggaScanner from "@src/Scanner"

export const VERSION = '0.1.0';

export const Scanner = QuaggaScanner;
28 changes: 21 additions & 7 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ const baseConfig = {

let config;
if (process.env.NODE_ENV === 'production') {

const productionConfig = merge(baseConfig, {
devtool: '#source-map',
plugins: (module.exports.plugins || []).concat([
Expand All @@ -78,14 +79,27 @@ if (process.env.NODE_ENV === 'production') {
minimize: true
})
]),
entry: path.resolve(__dirname + '/src/plugins.js'),
output: {
filename: 'vue-quagga.min.js',
libraryTarget: 'window',
library: 'Scanner'
}
});
config = productionConfig;
config = [
merge(productionConfig, {
entry: path.resolve(__dirname + '/src/plugins.js'),
output: {
filename: 'vue-quagga.min.js',
libraryTarget: 'window',
library: 'Scanner'
}
}),
merge(productionConfig,
{
entry: path.resolve(__dirname + '/src/index.js'),
output: {
filename: 'vue-quagga.js',
libraryTarget: 'umd',
library: 'Scanner',
umdNamedDefine: true
}
}),
];
}

module.exports = config;

0 comments on commit 76592b2

Please sign in to comment.