Update configuration to output types

This commit is contained in:
Matt Triff 2021-12-26 16:37:23 -05:00
parent 0b6973b322
commit bf94386cc5
4 changed files with 13 additions and 2 deletions

View File

@ -3,7 +3,7 @@
"version": "9.1.0",
"description": "A vanilla JS customisable text input/select box plugin",
"main": "./public/assets/scripts/choices.js",
"types": "./types/index.d.ts",
"types": "./public/types/src/index.d.ts",
"scripts": {
"start": "run-p js:watch css:watch",
"build": "run-p js:build css:build",

7
src/index.ts Normal file
View File

@ -0,0 +1,7 @@
import Choices from './scripts/choices';
export * from './scripts/constants';
export * from './scripts/defaults';
export { default as templates } from './scripts/templates';
export default Choices;

View File

@ -3,8 +3,12 @@
"baseUrl": "/",
"outDir": "./dist/",
"allowJs": true,
"declaration": true,
"declarationDir": "./public/types/",
"declarationMap": true,
"sourceMap": true,
"module": "commonjs",
"moduleResolution": "node",
"esModuleInterop": true,
"target": "es5",
"lib": ["es2017", "dom"],

View File

@ -8,7 +8,7 @@ const exclude = /node_modules/;
* @type {import('webpack').Configuration}
*/
module.exports = {
entry: ['./src/scripts/choices'],
entry: ['./src/index'],
module: {
rules: [
{