@atlassian/webresource-webpack-plugin 7.0.2 → 7.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AppResources.d.ts +59 -0
- package/dist/AppResources.js +171 -0
- package/dist/AppResources.js.map +1 -0
- package/dist/AppResourcesFactory.d.ts +10 -0
- package/dist/AppResourcesFactory.js +16 -0
- package/dist/AppResourcesFactory.js.map +1 -0
- package/dist/WebpackHelpers.d.ts +16 -0
- package/dist/WebpackHelpers.js +115 -0
- package/dist/WebpackHelpers.js.map +1 -0
- package/dist/WebpackRuntimeHelpers.d.ts +4 -0
- package/dist/WebpackRuntimeHelpers.js +21 -0
- package/dist/WebpackRuntimeHelpers.js.map +1 -0
- package/dist/WrmManifestPlugin.d.ts +9 -0
- package/dist/WrmManifestPlugin.js +44 -0
- package/dist/WrmManifestPlugin.js.map +1 -0
- package/dist/WrmPlugin.d.ts +45 -0
- package/dist/WrmPlugin.js +488 -0
- package/dist/WrmPlugin.js.map +1 -0
- package/dist/deps/base-dependencies.d.ts +8 -0
- package/dist/deps/base-dependencies.js +38 -0
- package/dist/deps/base-dependencies.js.map +1 -0
- package/dist/deps/provided-dependencies.d.ts +3 -0
- package/dist/deps/provided-dependencies.js +22 -0
- package/dist/deps/provided-dependencies.js.map +1 -0
- package/dist/helpers/file-system.d.ts +2 -0
- package/dist/helpers/file-system.js +23 -0
- package/dist/helpers/file-system.js.map +1 -0
- package/dist/helpers/options-parser.d.ts +3 -0
- package/dist/helpers/options-parser.js +28 -0
- package/dist/helpers/options-parser.js.map +1 -0
- package/dist/helpers/renderCondition.d.ts +3 -0
- package/dist/helpers/renderCondition.js +32 -0
- package/dist/helpers/renderCondition.js.map +1 -0
- package/dist/helpers/renderTransformations.d.ts +10 -0
- package/dist/helpers/renderTransformations.js +34 -0
- package/dist/helpers/renderTransformations.js.map +1 -0
- package/dist/helpers/string.d.ts +1 -0
- package/dist/helpers/string.js +9 -0
- package/dist/helpers/string.js.map +1 -0
- package/dist/helpers/web-resource-entrypoints.d.ts +9 -0
- package/dist/helpers/web-resource-entrypoints.js +44 -0
- package/dist/helpers/web-resource-entrypoints.js.map +1 -0
- package/dist/helpers/web-resource-generator.d.ts +2 -0
- package/dist/helpers/web-resource-generator.js +105 -0
- package/dist/helpers/web-resource-generator.js.map +1 -0
- package/dist/helpers/web-resource-parser.d.ts +2 -0
- package/dist/helpers/web-resource-parser.js +39 -0
- package/dist/helpers/web-resource-parser.js.map +1 -0
- package/dist/helpers/xml.d.ts +6 -0
- package/dist/helpers/xml.js +37 -0
- package/dist/helpers/xml.js.map +1 -0
- package/dist/logger.d.ts +4 -0
- package/dist/logger.js +26 -0
- package/dist/logger.js.map +1 -0
- package/dist/shims/require-ensure-shim.d.ts +2 -0
- package/dist/shims/require-ensure-shim.js +21 -0
- package/dist/shims/require-ensure-shim.js.map +1 -0
- package/dist/shims/runtime-load-shim.d.ts +14 -0
- package/dist/shims/runtime-load-shim.js +62 -0
- package/dist/shims/runtime-load-shim.js.map +1 -0
- package/dist/types/extracted-webpack-types.d.ts +12 -0
- package/dist/types/extracted-webpack-types.js +3 -0
- package/dist/types/extracted-webpack-types.js.map +1 -0
- package/dist/types/types.d.ts +132 -0
- package/dist/types/types.js +3 -0
- package/dist/types/types.js.map +1 -0
- package/dist/webpack-modules/EmptyExportsModule.d.ts +14 -0
- package/dist/webpack-modules/EmptyExportsModule.js +28 -0
- package/dist/webpack-modules/EmptyExportsModule.js.map +1 -0
- package/dist/webpack-modules/ProvidedExternalDependencyModule.d.ts +20 -0
- package/dist/webpack-modules/ProvidedExternalDependencyModule.js +36 -0
- package/dist/webpack-modules/ProvidedExternalDependencyModule.js.map +1 -0
- package/dist/webpack-modules/WrmDependencyModule.d.ts +6 -0
- package/dist/webpack-modules/WrmDependencyModule.js +17 -0
- package/dist/webpack-modules/WrmDependencyModule.js.map +1 -0
- package/dist/webpack-modules/WrmResourceModule.d.ts +10 -0
- package/dist/webpack-modules/WrmResourceModule.js +29 -0
- package/dist/webpack-modules/WrmResourceModule.js.map +1 -0
- package/package.json +2 -2
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
export declare type ArrayBaseType<T> = T extends Array<infer U> ? U : never;
|
|
2
|
+
export declare type Callable = (...args: any[]) => any;
|
|
3
|
+
export declare type ObjectOrMap = Record<string, unknown> | Map<string, unknown>;
|
|
4
|
+
export declare type ConditionParam = {
|
|
5
|
+
attributes?: {
|
|
6
|
+
[key: string]: string;
|
|
7
|
+
};
|
|
8
|
+
value?: string;
|
|
9
|
+
};
|
|
10
|
+
export declare type ConditionClass = {
|
|
11
|
+
class: string;
|
|
12
|
+
invert?: boolean;
|
|
13
|
+
params?: ConditionParam[];
|
|
14
|
+
};
|
|
15
|
+
export declare type Conditions = {
|
|
16
|
+
type: string;
|
|
17
|
+
conditions: Array<Conditions | ConditionClass>;
|
|
18
|
+
};
|
|
19
|
+
export declare type Condition = Conditions | ConditionClass | Array<Conditions | Condition>;
|
|
20
|
+
export declare type DeprecationInfo = {
|
|
21
|
+
sinceVersion?: string;
|
|
22
|
+
removeInVersion?: string;
|
|
23
|
+
alternative?: string;
|
|
24
|
+
extraInfo?: string;
|
|
25
|
+
} | true;
|
|
26
|
+
export declare type ProvidedDependency = {
|
|
27
|
+
dependency: string;
|
|
28
|
+
import: {
|
|
29
|
+
var: string;
|
|
30
|
+
amd?: string;
|
|
31
|
+
} | string;
|
|
32
|
+
};
|
|
33
|
+
export declare type DataProvider = {
|
|
34
|
+
key: string;
|
|
35
|
+
class: string;
|
|
36
|
+
};
|
|
37
|
+
export declare type ResourceParam = {
|
|
38
|
+
name: string;
|
|
39
|
+
value: string;
|
|
40
|
+
};
|
|
41
|
+
export declare type WebresourceObject = {
|
|
42
|
+
key?: string;
|
|
43
|
+
name?: string;
|
|
44
|
+
state?: string | boolean;
|
|
45
|
+
};
|
|
46
|
+
export declare type WebresourceType = string | WebresourceObject;
|
|
47
|
+
declare type MapOrObject<T> = Map<string, T> | {
|
|
48
|
+
[key: string]: T;
|
|
49
|
+
};
|
|
50
|
+
export declare type ContextMap = Map<string, string[]>;
|
|
51
|
+
export declare type TransformationMap = Map<string, string[]>;
|
|
52
|
+
export declare type ProvidedDependenciesMap = Map<string, ProvidedDependency>;
|
|
53
|
+
export declare type ConditionsMap = Map<string, Condition>;
|
|
54
|
+
export declare type DataProvidersMap = Map<string, DataProvider[]>;
|
|
55
|
+
export declare type DeprecationMap = Map<string, DeprecationInfo>;
|
|
56
|
+
export declare type ResourceParamMap = Map<string, ResourceParam[]>;
|
|
57
|
+
export declare type WebresourceMap = Map<string, WebresourceType>;
|
|
58
|
+
export declare type Options = {
|
|
59
|
+
/** @property pluginKey - The fully qualified plugin key. e.g.: com.atlassian.jira.plugins.my-jira-plugin */
|
|
60
|
+
pluginKey: string;
|
|
61
|
+
/** @property xmlDescriptors - Path to the directory where this plugin stores the descriptors about this plugin, used by the WRM to load your frontend code. */
|
|
62
|
+
xmlDescriptors: string;
|
|
63
|
+
/** @property packageName - Name of frontend package to associate all output JS files with. */
|
|
64
|
+
packageName?: string;
|
|
65
|
+
/** @property devAssetsHash - Custom hash used in development environment resources name. */
|
|
66
|
+
devAssetsHash?: string;
|
|
67
|
+
/** @property locationPrefix - Specify the sub-directory for all web-resource location values. */
|
|
68
|
+
locationPrefix?: string;
|
|
69
|
+
/** @property wrmManifestPath - Path to the WRM manifest file where this plugin stores the mapping of modules to generated web-resources. e.g.: `{"my-entry": "com.example.app:entrypoint-my-entry"}`. Useful if you set { output: { library, libraryTarget } } in your webpack config, to use your build result as provided dependencies for other builds. */
|
|
70
|
+
wrmManifestPath?: string;
|
|
71
|
+
/** @property singleRuntimeWebResourceKey - Ensure all web-resources depend on a single runtime shared amongst them */
|
|
72
|
+
singleRuntimeWebResourceKey?: string;
|
|
73
|
+
/** @property conditionMap - Conditions to be applied to the specified entry-point */
|
|
74
|
+
conditionMap?: MapOrObject<Condition>;
|
|
75
|
+
/** @property contextMap - One or more "context"s to which an entrypoint will be added. e.g.: `{"my-entry": ["my-plugin-context", "another-context"]}` */
|
|
76
|
+
contextMap?: MapOrObject<string[]>;
|
|
77
|
+
/** @property dataProvidersMap - A list of data providers that will be added to the entry point e.g.: `{"my-entry": [{ key: "data-provider-key", class: "my.data.provider.JavaClass" }]}` */
|
|
78
|
+
dataProvidersMap?: MapOrObject<DataProvider[]>;
|
|
79
|
+
/** @property deprecatedEntrypoints - Map of entrypoints that are deprecated to more detailed information about the deprecation including the affected versions, alternatives and reason. e.g.: `{"outdated-entrypoint": { sinceVersion: "2.0.0", removeInVersion: "3.0.0", alternative: "rewritten-endpoint", extraInfo: "outdated-endpoint does not support dark mode" }}` */
|
|
80
|
+
deprecatedEntrypoints?: MapOrObject<DeprecationInfo>;
|
|
81
|
+
/** @property providedDependencies - Map of ES6/AMD module identifiers to their related WRM module keys and JavaScript import values (read: webpack external dependency definition). If this module identifier is imported or required somewhere in the compiled code, it will not be bundled, but instead replaced with the specified external dependency placeholder. */
|
|
82
|
+
providedDependencies?: MapOrObject<ProvidedDependency>;
|
|
83
|
+
/** @property resourceParamMap - Parameters to be added to specific file types. */
|
|
84
|
+
resourceParamMap?: MapOrObject<ResourceParam[]>;
|
|
85
|
+
/** @property transformationMap - Transformations to be applied to the specified file-types. */
|
|
86
|
+
transformationMap?: MapOrObject<string[]> | false;
|
|
87
|
+
/** @property webresourceKeyMap - An explicit name for the web-resource generated per entry point. e.g.: `{"my-entry": "legacy-webresource-name"}`. */
|
|
88
|
+
webresourceKeyMap?: MapOrObject<WebresourceType>;
|
|
89
|
+
/** @property addAsyncNameAsContext - Adds the name of the async chunk as a context prefixed by `async-chunk-`. Will only do so if a webpackChunkName is set. */
|
|
90
|
+
addAsyncNameAsContext?: boolean;
|
|
91
|
+
/** @property addEntrypointNameAsContext - Guarantees each entrypoint will be given a context matching its name. Use with caution; this can adversely affect page weight and may conflict with other plugins and feature code. */
|
|
92
|
+
addEntrypointNameAsContext?: boolean;
|
|
93
|
+
/** @property noWRM - Do not add any WRM specifics to the webpack runtime to allow development on a greenfield. */
|
|
94
|
+
noWRM?: boolean;
|
|
95
|
+
/** @property useDocumentWriteInWatchMode - Use document.write when possible in "watch-mode" to ensure scripts are loaded "blocking" as they would be in a production environment */
|
|
96
|
+
useDocumentWriteInWatchMode?: boolean;
|
|
97
|
+
/** @property verbose - Indicate if log output should be verbose. */
|
|
98
|
+
verbose?: boolean;
|
|
99
|
+
/** @property watch - Trigger watch mode - this requires webpack-dev-server and will redirect requests to the entrypoints to the dev-server that must be running under webpack's `options.output.publicPath`. */
|
|
100
|
+
watch?: boolean;
|
|
101
|
+
/** @property watchPrepare - In conjunction with watch mode - indicates that only "redirects" to a webserver should be build in this run. */
|
|
102
|
+
watchPrepare?: boolean;
|
|
103
|
+
};
|
|
104
|
+
export declare type ConsolidatedOptions = Options & Required<Omit<Options, 'wrmManifestPath' | 'singleRuntimeWebResourceKey' | 'packageName'>> & {
|
|
105
|
+
conditionMap: ConditionsMap;
|
|
106
|
+
contextMap: ContextMap;
|
|
107
|
+
dataProvidersMap: DataProvidersMap;
|
|
108
|
+
deprecatedEntrypoints: DeprecationMap;
|
|
109
|
+
providedDependencies: ProvidedDependenciesMap;
|
|
110
|
+
resourceParamMap: ResourceParamMap;
|
|
111
|
+
transformationMap: TransformationMap;
|
|
112
|
+
webresourceKeyMap: WebresourceMap;
|
|
113
|
+
};
|
|
114
|
+
export declare type WrmResource = {
|
|
115
|
+
name: string;
|
|
116
|
+
location: string;
|
|
117
|
+
};
|
|
118
|
+
export declare type ChunkResourceDescriptor = {
|
|
119
|
+
attributes: {
|
|
120
|
+
key: string;
|
|
121
|
+
moduleId?: string;
|
|
122
|
+
};
|
|
123
|
+
resources: string[];
|
|
124
|
+
dependencies?: string[];
|
|
125
|
+
deprecationInfo?: DeprecationInfo;
|
|
126
|
+
contexts?: string[];
|
|
127
|
+
conditions?: Condition;
|
|
128
|
+
dataProviders?: DataProvider[];
|
|
129
|
+
externalResources?: WrmResource[];
|
|
130
|
+
};
|
|
131
|
+
export declare type AssetNames = Map<string, string>;
|
|
132
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { sources } from 'webpack';
|
|
2
|
+
import DllModule from 'webpack/lib/DllModule';
|
|
3
|
+
/**
|
|
4
|
+
* This module type allows inclusion of special dependencies in the webpack compilation process
|
|
5
|
+
* that ultimately output nothing in the compiled bundles.
|
|
6
|
+
*
|
|
7
|
+
* This is of use when including certain file types with no associated loader in the compilation process,
|
|
8
|
+
* as is the case with things like Atlassian Soy templates.
|
|
9
|
+
*/
|
|
10
|
+
export default class EmptyExportsModule extends DllModule {
|
|
11
|
+
constructor(dependency: string, type: string);
|
|
12
|
+
chunkCondition(): boolean;
|
|
13
|
+
source(): sources.RawSource;
|
|
14
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const DllModule_1 = __importDefault(require("webpack/lib/DllModule"));
|
|
7
|
+
const webpack_sources_1 = require("webpack-sources");
|
|
8
|
+
/**
|
|
9
|
+
* This module type allows inclusion of special dependencies in the webpack compilation process
|
|
10
|
+
* that ultimately output nothing in the compiled bundles.
|
|
11
|
+
*
|
|
12
|
+
* This is of use when including certain file types with no associated loader in the compilation process,
|
|
13
|
+
* as is the case with things like Atlassian Soy templates.
|
|
14
|
+
*/
|
|
15
|
+
class EmptyExportsModule extends DllModule_1.default {
|
|
16
|
+
constructor(dependency, type) {
|
|
17
|
+
super(null, [], dependency, type);
|
|
18
|
+
}
|
|
19
|
+
chunkCondition() {
|
|
20
|
+
return true;
|
|
21
|
+
}
|
|
22
|
+
source() {
|
|
23
|
+
// eslint-disable-next-line prettier/prettier
|
|
24
|
+
return new webpack_sources_1.RawSource('module.exports = undefined;');
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
exports.default = EmptyExportsModule;
|
|
28
|
+
//# sourceMappingURL=EmptyExportsModule.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EmptyExportsModule.js","sourceRoot":"","sources":["../../src/webpack-modules/EmptyExportsModule.ts"],"names":[],"mappings":";;;;;AACA,sEAA8C;AAC9C,qDAA4C;AAE5C;;;;;;GAMG;AACH,MAAqB,kBAAmB,SAAQ,mBAAS;IACvD,YAAY,UAAkB,EAAE,IAAY;QAC1C,KAAK,CAAC,IAAI,EAAE,EAAE,EAAE,UAAU,EAAE,IAAI,CAAC,CAAC;IACpC,CAAC;IAED,cAAc;QACZ,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM;QACJ,6CAA6C;QAC7C,OAAO,IAAI,2BAAS,CAAC,6BAA6B,CAAiC,CAAC;IACtF,CAAC;CACF;AAbD,qCAaC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import ExternalModule from 'webpack/lib/ExternalModule';
|
|
2
|
+
import type { ProvidedDependency } from '../types/types';
|
|
3
|
+
/**
|
|
4
|
+
* ProvidedExternalModule ensures that the `chunkCondition` is true to allow proper asyncChunk context handling
|
|
5
|
+
* ExternalModules can be defined in different ways. Some of them require the external module to be loaded in the entry point.
|
|
6
|
+
* This is generally not bad as it doesnt cost anything. However the WRM Plugin relies on ExternalModules to specify provided dependencies.
|
|
7
|
+
* These provided dependencies are then added to the context of the chunk in which they occur. Async chunks should therefore
|
|
8
|
+
* have their own dependencies to make the entrypoint as small as possible.
|
|
9
|
+
* ProvidedExternalModule ensures that.
|
|
10
|
+
*/
|
|
11
|
+
export default class ProvidedExternalDependencyModule extends ExternalModule {
|
|
12
|
+
private _wrmDependency;
|
|
13
|
+
private _request;
|
|
14
|
+
private _target;
|
|
15
|
+
constructor(request: ProvidedDependency['import'], dependency: string, target: 'var' | 'amd');
|
|
16
|
+
libIdent(): string;
|
|
17
|
+
chunkCondition(): boolean;
|
|
18
|
+
getDependency(): string;
|
|
19
|
+
getConcatenationBailoutReason(): string;
|
|
20
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const ExternalModule_1 = __importDefault(require("webpack/lib/ExternalModule"));
|
|
7
|
+
/**
|
|
8
|
+
* ProvidedExternalModule ensures that the `chunkCondition` is true to allow proper asyncChunk context handling
|
|
9
|
+
* ExternalModules can be defined in different ways. Some of them require the external module to be loaded in the entry point.
|
|
10
|
+
* This is generally not bad as it doesnt cost anything. However the WRM Plugin relies on ExternalModules to specify provided dependencies.
|
|
11
|
+
* These provided dependencies are then added to the context of the chunk in which they occur. Async chunks should therefore
|
|
12
|
+
* have their own dependencies to make the entrypoint as small as possible.
|
|
13
|
+
* ProvidedExternalModule ensures that.
|
|
14
|
+
*/
|
|
15
|
+
class ProvidedExternalDependencyModule extends ExternalModule_1.default {
|
|
16
|
+
constructor(request, dependency, target) {
|
|
17
|
+
super(request, target);
|
|
18
|
+
this._request = request;
|
|
19
|
+
this._wrmDependency = dependency;
|
|
20
|
+
this._target = target;
|
|
21
|
+
}
|
|
22
|
+
libIdent() {
|
|
23
|
+
return `${this._wrmDependency}/${typeof this._request === 'string' ? this._request : this._request[this._target]}`;
|
|
24
|
+
}
|
|
25
|
+
chunkCondition() {
|
|
26
|
+
return true;
|
|
27
|
+
}
|
|
28
|
+
getDependency() {
|
|
29
|
+
return this._wrmDependency;
|
|
30
|
+
}
|
|
31
|
+
getConcatenationBailoutReason() {
|
|
32
|
+
return `Provided external dependencies can't be concatenated`;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
exports.default = ProvidedExternalDependencyModule;
|
|
36
|
+
//# sourceMappingURL=ProvidedExternalDependencyModule.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ProvidedExternalDependencyModule.js","sourceRoot":"","sources":["../../src/webpack-modules/ProvidedExternalDependencyModule.ts"],"names":[],"mappings":";;;;;AAAA,gFAAwD;AAIxD;;;;;;;GAOG;AACH,MAAqB,gCAAiC,SAAQ,wBAAc;IAK1E,YAAY,OAAqC,EAAE,UAAkB,EAAE,MAAqB;QAC1F,KAAK,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;QACvB,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;QACxB,IAAI,CAAC,cAAc,GAAG,UAAU,CAAC;QACjC,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;IACxB,CAAC;IAED,QAAQ;QACN,OAAO,GAAG,IAAI,CAAC,cAAc,IAAI,OAAO,IAAI,CAAC,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;IACrH,CAAC;IAED,cAAc;QACZ,OAAO,IAAI,CAAC;IACd,CAAC;IAED,aAAa;QACX,OAAO,IAAI,CAAC,cAAc,CAAC;IAC7B,CAAC;IAED,6BAA6B;QAC3B,OAAO,sDAAsD,CAAC;IAChE,CAAC;CACF;AA3BD,mDA2BC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const EmptyExportsModule_1 = __importDefault(require("./EmptyExportsModule"));
|
|
7
|
+
class WrmDependencyModule extends EmptyExportsModule_1.default {
|
|
8
|
+
constructor(dependency, type, pluginKey) {
|
|
9
|
+
super(dependency, type);
|
|
10
|
+
this._wrmDependency = dependency.includes(':') ? dependency : `${pluginKey}:${dependency}`;
|
|
11
|
+
}
|
|
12
|
+
getDependency() {
|
|
13
|
+
return this._wrmDependency;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
exports.default = WrmDependencyModule;
|
|
17
|
+
//# sourceMappingURL=WrmDependencyModule.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WrmDependencyModule.js","sourceRoot":"","sources":["../../src/webpack-modules/WrmDependencyModule.ts"],"names":[],"mappings":";;;;;AAAA,8EAAsD;AAEtD,MAAqB,mBAAoB,SAAQ,4BAAkB;IAGjE,YAAY,UAAkB,EAAE,IAAY,EAAE,SAAiB;QAC7D,KAAK,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;QACxB,IAAI,CAAC,cAAc,GAAG,UAAU,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,GAAG,SAAS,IAAI,UAAU,EAAE,CAAC;IAC7F,CAAC;IAED,aAAa;QACX,OAAO,IAAI,CAAC,cAAc,CAAC;IAC7B,CAAC;CACF;AAXD,sCAWC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import EmptyExportsModule from './EmptyExportsModule';
|
|
2
|
+
export default class WrmResourceModule extends EmptyExportsModule {
|
|
3
|
+
private _resource;
|
|
4
|
+
constructor(resourceNameAndLocationPair: string, target: string, requestContext: string, rootContext: string);
|
|
5
|
+
getResourcePair(): [string, string];
|
|
6
|
+
getResource(): {
|
|
7
|
+
name: string;
|
|
8
|
+
location: string;
|
|
9
|
+
};
|
|
10
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const path_1 = __importDefault(require("path"));
|
|
7
|
+
const EmptyExportsModule_1 = __importDefault(require("./EmptyExportsModule"));
|
|
8
|
+
class WrmResourceModule extends EmptyExportsModule_1.default {
|
|
9
|
+
constructor(resourceNameAndLocationPair, target, requestContext, rootContext) {
|
|
10
|
+
super(resourceNameAndLocationPair, target);
|
|
11
|
+
const resourcePair = resourceNameAndLocationPair.split('!');
|
|
12
|
+
let resPath = resourcePair[1];
|
|
13
|
+
// enable relative resource-paths. Still requires that this resource is correctly copied to the right location in target.
|
|
14
|
+
if (resPath.startsWith('./') || resPath.startsWith('../')) {
|
|
15
|
+
const fullResourcePath = path_1.default.join(requestContext, resPath);
|
|
16
|
+
resPath = path_1.default.relative(rootContext, fullResourcePath);
|
|
17
|
+
}
|
|
18
|
+
this._resource = [resourcePair[0], resPath];
|
|
19
|
+
}
|
|
20
|
+
getResourcePair() {
|
|
21
|
+
return this._resource;
|
|
22
|
+
}
|
|
23
|
+
getResource() {
|
|
24
|
+
const [name, location] = this._resource;
|
|
25
|
+
return { name, location };
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
exports.default = WrmResourceModule;
|
|
29
|
+
//# sourceMappingURL=WrmResourceModule.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WrmResourceModule.js","sourceRoot":"","sources":["../../src/webpack-modules/WrmResourceModule.ts"],"names":[],"mappings":";;;;;AAAA,gDAAwB;AAExB,8EAAsD;AAEtD,MAAqB,iBAAkB,SAAQ,4BAAkB;IAG/D,YAAY,2BAAmC,EAAE,MAAc,EAAE,cAAsB,EAAE,WAAmB;QAC1G,KAAK,CAAC,2BAA2B,EAAE,MAAM,CAAC,CAAC;QAC3C,MAAM,YAAY,GAAG,2BAA2B,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAC5D,IAAI,OAAO,GAAG,YAAY,CAAC,CAAC,CAAC,CAAC;QAE9B,yHAAyH;QACzH,IAAI,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE;YACzD,MAAM,gBAAgB,GAAG,cAAI,CAAC,IAAI,CAAC,cAAc,EAAE,OAAO,CAAC,CAAC;YAC5D,OAAO,GAAG,cAAI,CAAC,QAAQ,CAAC,WAAW,EAAE,gBAAgB,CAAC,CAAC;SACxD;QAED,IAAI,CAAC,SAAS,GAAG,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;IAC9C,CAAC;IAED,eAAe;QACb,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;IAED,WAAW;QACT,MAAM,CAAC,IAAI,EAAE,QAAQ,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC;QACxC,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;IAC5B,CAAC;CACF;AAzBD,oCAyBC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlassian/webresource-webpack-plugin",
|
|
3
|
-
"version": "7.0.
|
|
3
|
+
"version": "7.0.3",
|
|
4
4
|
"description": "Auto-generates web-resource definitions from your webpacked code, for usage in an Atlassian product or plugin.",
|
|
5
5
|
"main": "dist/WrmPlugin.js",
|
|
6
6
|
"types": "dist/WrmPlugin.d.ts",
|
|
@@ -116,5 +116,5 @@
|
|
|
116
116
|
"test": "jest",
|
|
117
117
|
"test:watch": "jest --watch"
|
|
118
118
|
},
|
|
119
|
-
"gitHead": "
|
|
119
|
+
"gitHead": "97de29c8ee207d7c11d0a48b457a7b83202cdf43"
|
|
120
120
|
}
|