-
-
Notifications
You must be signed in to change notification settings - Fork 779
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Three improvements for the price of one (#291)
* Cleanup build Partial: Requires next commit for a proper version! * Port tests to the Jest framework * Fix typings and cover them in a test This should resolve #261 as long as the system of the test is being used. That being said, this system allows for a fully typed configuration with IDE support TypeScript usage is further described in the documentation, so please accept that PR if this one is accepted. * Run standard-format * Remove duplicate types field from package
- Loading branch information
Showing
22 changed files
with
6,729 additions
and
10,647 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,3 @@ | ||
{ | ||
"presets": ["@babel/preset-env"], | ||
"plugins": [ | ||
"babel-plugin-add-module-exports" | ||
] | ||
"presets": ["@babel/preset-env", "@babel/preset-typescript"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,17 @@ | ||
# Filter node stuff | ||
node_modules/ | ||
npm-debug.log | ||
*.log | ||
|
||
# Filter MacOS folder store | ||
.DS_Store | ||
.idea | ||
|
||
# Filter IDE settings | ||
.idea/ | ||
.vs/ | ||
.vscode/ | ||
|
||
# Only publish 1 type of lockfile | ||
package-lock.json | ||
|
||
# Filter test runner | ||
runner.js |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
const webpack = require('webpack') | ||
const path = require('path') | ||
const fs = require('fs') | ||
const pckg = require('../package.json') | ||
|
||
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') | ||
|
||
module.exports = { | ||
entry: path.resolve(__dirname, '../src/index.js'), | ||
plugins: [ | ||
new webpack.BannerPlugin({ | ||
banner: copyright | ||
.replace('{VERSION}', `v${VERSION}`) | ||
.replace('{AUTHOR_URL}', `${AUTHOR.url}`) | ||
.replace('{HOMEPAGE}', `${HOMEPAGE}`), | ||
entryOnly: true | ||
}) | ||
], | ||
output: { | ||
path: path.resolve(__dirname, '../dist'), | ||
filename: `${LIBRARY_NAME}.js`, | ||
library: 'Fuse', | ||
libraryTarget: 'umd', | ||
umdNamedDefine: true, | ||
globalObject: 'this' | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
const merge = require('webpack-merge') | ||
const common = require('./webpack.common.js') | ||
|
||
module.exports = merge(common, { | ||
mode: 'development', | ||
devtool: 'inline-source-map' | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
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()] | ||
} | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.