Browse Source

Update configuration to output types

pull/985/head
Matt Triff 1 month ago
parent
commit
bf94386cc5
  1. 2
      package.json
  2. 7
      src/index.ts
  3. 4
      tsconfig.json
  4. 2
      webpack.config.base.js

2
package.json

@ -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

@ -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;

4
tsconfig.json

@ -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"],

2
webpack.config.base.js

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

Loading…
Cancel
Save