@mirta/rollup 0.0.2 → 0.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/index.mjs +16 -13
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -101,32 +101,34 @@ function wbRulesImports() {
|
|
|
101
101
|
|
|
102
102
|
const env = process.env.NODE_ENV;
|
|
103
103
|
const isProduction = env === 'production';
|
|
104
|
-
const scriptsPattern = /src\/wb-rules\/(.*)/;
|
|
105
|
-
const modulesPattern = /src\/wb-rules-modules\/(.*)/;
|
|
106
104
|
const packagesPattern = /node_modules\/@?(.*)\/dist\/(.*)/;
|
|
107
|
-
|
|
105
|
+
const modulesPattern = /(?:src\/)?wb-rules-modules\/(.*)/;
|
|
106
|
+
const scriptsPattern = /(?:src\/)?(?:wb-rules\/)?(.*)/;
|
|
107
|
+
function packageEntry(pkg, entry) {
|
|
108
|
+
const key = entry ? `${pkg}/${entry}` : pkg;
|
|
108
109
|
// if ((process.env.NODE_ENV !== 'production'))
|
|
109
|
-
// console.debug(`
|
|
110
|
-
return `wb-rules/${
|
|
110
|
+
// console.debug(`Package Entry: ${key}`)
|
|
111
|
+
return `wb-rules-modules/packages/${key}.js`;
|
|
111
112
|
}
|
|
112
113
|
function moduleEntry(entry) {
|
|
113
114
|
// if ((process.env.NODE_ENV !== 'production'))
|
|
114
115
|
// console.debug(`Module Entry: ${entry}`)
|
|
115
116
|
return `wb-rules-modules/${entry}.js`;
|
|
116
117
|
}
|
|
117
|
-
function
|
|
118
|
-
const key = entry ? `${pkg}/${entry}` : pkg;
|
|
118
|
+
function scriptEntry(entry) {
|
|
119
119
|
// if ((process.env.NODE_ENV !== 'production'))
|
|
120
|
-
// console.debug(`
|
|
121
|
-
return `wb-rules
|
|
120
|
+
// console.debug(`Script Entry: ${entry}`)
|
|
121
|
+
return `wb-rules/${entry}.js`;
|
|
122
122
|
}
|
|
123
123
|
function getEntry(path) {
|
|
124
|
+
if (path.startsWith('_virtual'))
|
|
125
|
+
return path;
|
|
124
126
|
let match;
|
|
125
|
-
match =
|
|
127
|
+
match = packagesPattern.exec(path);
|
|
126
128
|
if (match) {
|
|
127
129
|
// if ((process.env.NODE_ENV !== 'production'))
|
|
128
130
|
// console.debug(match)
|
|
129
|
-
return
|
|
131
|
+
return packageEntry(match[1], match[2]);
|
|
130
132
|
}
|
|
131
133
|
match = modulesPattern.exec(path);
|
|
132
134
|
if (match) {
|
|
@@ -134,12 +136,13 @@ function getEntry(path) {
|
|
|
134
136
|
// console.debug(match)
|
|
135
137
|
return moduleEntry(match[1]);
|
|
136
138
|
}
|
|
137
|
-
match =
|
|
139
|
+
match = scriptsPattern.exec(path);
|
|
138
140
|
if (match) {
|
|
139
141
|
// if ((process.env.NODE_ENV !== 'production'))
|
|
140
142
|
// console.debug(match)
|
|
141
|
-
return
|
|
143
|
+
return scriptEntry(match[1]);
|
|
142
144
|
}
|
|
145
|
+
// console.log(`No one! ${path}`)
|
|
143
146
|
return path;
|
|
144
147
|
}
|
|
145
148
|
/**
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mirta/rollup",
|
|
3
3
|
"description": "Predefined Rollup configuration for wb-rules project builds.",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.3",
|
|
5
5
|
"license": "Unlicense",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"mirta",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"magic-string": "^0.30.17",
|
|
42
42
|
"rollup-plugin-typescript2": "^0.36.0",
|
|
43
43
|
"typescript": "^5.8.3",
|
|
44
|
-
"@mirta/polyfills": "0.0.
|
|
44
|
+
"@mirta/polyfills": "0.0.3"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"rollup": "^4.45.1"
|