Skip to content

Commit

Permalink
Now generates distribution
Browse files Browse the repository at this point in the history
Fixing bug #74
  • Loading branch information
eklem committed Jul 5, 2019
1 parent 242df73 commit 830b6c1
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 40 deletions.
2 changes: 1 addition & 1 deletion demo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="./mini-default.min.css">
<link rel="stylesheet" href="./mini-additions.css">
<script src="../dist/stopword.0.3.0.js"></script>
<script src="../dist/stopword.0.3.1.js"></script>
<title>Stopword browser demo</title>
</head>

Expand Down
1 change: 1 addition & 0 deletions dist/stopword.0.3.1.js

Large diffs are not rendered by default.

41 changes: 11 additions & 30 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"name": "stopword",
"version": "0.3.0",
"version": "0.3.1",
"description": "A module for node.js and the browser that takes in text and returns text that is stripped of stopwords. Has pre-defined stopword lists for 32 languages and also takes lists with custom stopwords as input.",
"main": "lib/stopword.js",
"scripts": {
"compile-for-browser": "webpack",
"empty-sandbox": "rm -rf test/sandbox && mkdir test/sandbox",
"test": "npm run empty-sandbox && npm run compile-for-browser && tape ./test/test.js && cat test/sandbox/bundle.js | tape-run && npm run empty-sandbox"
"test": "npm run empty-sandbox && npm run compile-for-browser && tape ./test/test.js && cat test/sandbox/bundle.js | tape-run && rm -rf test/sandbox"
},
"repository": {
"type": "git",
Expand Down
13 changes: 6 additions & 7 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@ const path = require('path')
const package = require('./package.json')
const glob = require('glob')


module.exports = [
// Generating browser version of stopword

module.exports = {
{
mode: 'production',
entry: './lib/stopword.js',
output: {
Expand All @@ -14,11 +13,10 @@ const glob = require('glob')
library: 'sw'
},
devtool: "none", // prevent webpack from using eval() on my module
}
},

// Generating test script for the browser

module.exports = {
{
mode: 'production',
entry: glob.sync('./test/test.js'),
output: {
Expand All @@ -28,4 +26,5 @@ module.exports = {
node: {
fs: 'empty'
}
}
}
]

0 comments on commit 830b6c1

Please sign in to comment.