Skip to content

Commit

Permalink
v3.4.5
Browse files Browse the repository at this point in the history
  • Loading branch information
krisk committed May 30, 2019
1 parent 248ee31 commit fe1ff83
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 18 deletions.
17 changes: 13 additions & 4 deletions configs/webpack.common.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,18 @@ const webpack = require('webpack')
const path = require('path')
const fs = require('fs')
const pckg = require('../package.json')
const CopyPlugin = require('copy-webpack-plugin')

const LIBRARY_NAME = 'fuse'
const VERSION = pckg.version
const AUTHOR = pckg.author
const HOMEPAGE = pckg.homepage

const copyright = fs.readFileSync(path.resolve(__dirname, '../COPYRIGHT.txt'), 'UTF8')
const banner = copyright
.replace('{VERSION}', `v${VERSION}`)
.replace('{AUTHOR_URL}', `${AUTHOR.url}`)
.replace('{HOMEPAGE}', `${HOMEPAGE}`)

module.exports = {
entry: path.resolve(__dirname, '../src/index.js'),
Expand All @@ -25,11 +30,15 @@ module.exports = {
}]
},
plugins: [
new CopyPlugin([{
from: path.resolve(__dirname, '../src/typings.d.ts'),
to: path.resolve(__dirname, '../dist/fuse.d.ts'),
transform (content, path) {
return `// Type definitions for Fuse.js v${VERSION}\n${content}`
}
}]),
new webpack.BannerPlugin({
banner: copyright
.replace('{VERSION}', `v${VERSION}`)
.replace('{AUTHOR_URL}', `${AUTHOR.url}`)
.replace('{HOMEPAGE}', `${HOMEPAGE}`),
banner,
entryOnly: true
})
],
Expand Down
2 changes: 1 addition & 1 deletion configs/webpack.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ const common = require('./webpack.common.js')
module.exports = merge(common, {
mode: 'development',
devtool: 'inline-source-map'
})
})
8 changes: 0 additions & 8 deletions configs/webpack.prod.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,10 @@
const merge = require('webpack-merge')
const path = require('path')
const common = require('./webpack.common.js')
const TerserPlugin = require('terser-webpack-plugin')
const CopyPlugin = require('copy-webpack-plugin')

module.exports = merge(common, {
mode: 'production',
devtool: false,
plugins: [
new CopyPlugin([{
from: path.resolve(__dirname, '../src/typings.d.ts'),
to: path.resolve(__dirname, '../dist/fuse.d.ts')
}])
],
optimization: {
minimizer: [new TerserPlugin()]
}
Expand Down
4 changes: 2 additions & 2 deletions dist/fuse.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Type definitions for Fuse.js 3.4
// Type definitions for Fuse.js v3.4.5
// TypeScript Version: 3.1

export = Fuse;
Expand Down Expand Up @@ -31,7 +31,7 @@ declare namespace Fuse {
shouldSort?: boolean;
sortFn?: (a: { score: number }, b: { score: number }) => number;
getFn?: (obj: any, path: string) => any;
keys?: (keyof T)[] | { name: keyof T; weight: number }[];
keys?: (keyof T)[] | T[keyof T] | { name: keyof T; weight: number }[];
verbose?: boolean;
tokenize?: boolean;
tokenSeparator?: RegExp;
Expand Down
2 changes: 1 addition & 1 deletion dist/fuse.js

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"email": "kirollos@gmail.com",
"url": "http://kiro.me"
},
"version": "3.4.4",
"version": "3.4.5",
"description": "Lightweight fuzzy-search",
"license": "Apache-2.0",
"repository": {
Expand Down
1 change: 0 additions & 1 deletion src/typings.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// Type definitions for Fuse.js 3.4
// TypeScript Version: 3.1

export = Fuse;
Expand Down

0 comments on commit fe1ff83

Please sign in to comment.