mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
feat(webpack-cdn-inject): new type definition (#45530)
Type definition for small webpack plugin: - definition file - tests https://github.com/drolsen/webpack-cdn-inject#readme Thanks!
This commit is contained in:
parent
4bae021f45
commit
dd3765e494
28
types/webpack-cdn-inject/index.d.ts
vendored
Normal file
28
types/webpack-cdn-inject/index.d.ts
vendored
Normal file
@ -0,0 +1,28 @@
|
||||
// Type definitions for webpack-cdn-inject 1.0
|
||||
// Project: https://github.com/drolsen/webpack-cdn-inject#readme
|
||||
// Definitions by: Piotr Błażejewicz <https://github.com/peterblazejewicz>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
import { Plugin } from 'webpack';
|
||||
|
||||
/**
|
||||
* Plugin to inject CDN assets into HTML documents.
|
||||
*/
|
||||
declare namespace WebpackCDNInject {
|
||||
interface Options {
|
||||
/**
|
||||
* Defines urls to be added to document head (tag type is defined by url's file extension).
|
||||
*/
|
||||
head?: string[];
|
||||
/**
|
||||
* Defines urls to be added to document body (tag type is defined by url's file extension).
|
||||
*/
|
||||
body?: string[];
|
||||
}
|
||||
}
|
||||
|
||||
declare class WebpackCDNInject extends Plugin {
|
||||
constructor(options?: WebpackCDNInject.Options);
|
||||
}
|
||||
|
||||
export = WebpackCDNInject;
|
||||
23
types/webpack-cdn-inject/tsconfig.json
Normal file
23
types/webpack-cdn-inject/tsconfig.json
Normal file
@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictFunctionTypes": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"webpack-cdn-inject-tests.ts"
|
||||
]
|
||||
}
|
||||
1
types/webpack-cdn-inject/tslint.json
Normal file
1
types/webpack-cdn-inject/tslint.json
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
19
types/webpack-cdn-inject/webpack-cdn-inject-tests.ts
Normal file
19
types/webpack-cdn-inject/webpack-cdn-inject-tests.ts
Normal file
@ -0,0 +1,19 @@
|
||||
import { Configuration } from 'webpack';
|
||||
import WebpackCDNInject = require('webpack-cdn-inject');
|
||||
|
||||
const config: Configuration = {
|
||||
plugins: [
|
||||
new WebpackCDNInject(),
|
||||
new WebpackCDNInject({}),
|
||||
new WebpackCDNInject({
|
||||
body: ['url.js', 'url.css'],
|
||||
}),
|
||||
new WebpackCDNInject({
|
||||
head: ['url.css', 'url.js'],
|
||||
}),
|
||||
new WebpackCDNInject({
|
||||
body: ['url.js', 'url.css'],
|
||||
head: ['url.css', 'url.js'],
|
||||
}),
|
||||
],
|
||||
};
|
||||
Loading…
Reference in New Issue
Block a user