feat: working bundle, example config
This commit is contained in:
parent
8be80c3803
commit
e8173d4be4
|
@ -1,8 +1,10 @@
|
|||
|
||||
import resolve from 'rollup-plugin-node-resolve';
|
||||
import commonjs from 'rollup-plugin-commonjs';
|
||||
import replace from 'rollup-plugin-replace';
|
||||
import resolve from 'rollup-plugin-node-resolve';
|
||||
import typescript from 'rollup-plugin-typescript2';
|
||||
|
||||
const metadata = require('../package.json');
|
||||
|
||||
// `npm run build` -> `production` is true
|
||||
// `npm run dev` -> `production` is false
|
||||
const production = !process.env.ROLLUP_WATCH;
|
||||
|
@ -15,6 +17,17 @@ export default {
|
|||
sourcemap: true,
|
||||
},
|
||||
plugins: [
|
||||
replace({
|
||||
delimiters: ['{{ ', ' }}'],
|
||||
values: {
|
||||
APP_NAME: metadata.name,
|
||||
BUILD_JOB: '0',
|
||||
BUILD_RUNNER: 'rollup',
|
||||
GIT_BRANCH: '',
|
||||
GIT_COMMIT: '',
|
||||
NODE_VERSION: '',
|
||||
},
|
||||
}),
|
||||
resolve({
|
||||
preferBuiltins: true,
|
||||
}),
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
data:
|
||||
logger:
|
||||
name: salty
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"name": "unknown",
|
||||
"name": "salty",
|
||||
"version": "0.1.0",
|
||||
"description": "YAML linter, transformer, and validator",
|
||||
"main": "out/index.js",
|
||||
|
@ -28,6 +28,7 @@
|
|||
"rollup": "^1.15.5",
|
||||
"rollup-plugin-commonjs": "^10.0.0",
|
||||
"rollup-plugin-node-resolve": "^5.0.2",
|
||||
"rollup-plugin-replace": "^2.2.0",
|
||||
"rollup-plugin-typescript2": "^0.21.1",
|
||||
"typescript": "^3.5.2"
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { BaseError } from 'noicejs/error/BaseError';
|
||||
|
||||
export class InvalidArgumentError extends BaseError {
|
||||
constructor(msg = 'invalid argument passed', ...nested: Array<Error>) {
|
||||
super(msg, ...nested);
|
||||
}
|
||||
}
|
||||
import { BaseError } from 'noicejs';
|
||||
|
||||
export class InvalidArgumentError extends BaseError {
|
||||
constructor(msg = 'invalid argument passed', ...nested: Array<Error>) {
|
||||
super(msg, ...nested);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { BaseError } from 'noicejs/error/BaseError';
|
||||
import { BaseError } from 'noicejs';
|
||||
|
||||
export class NotFoundError extends BaseError {
|
||||
constructor(msg = 'value not found', ...nested: Array<Error>) {
|
||||
|
|
|
@ -1,24 +1,14 @@
|
|||
// webpack environment defines
|
||||
declare const APP_NAME: string;
|
||||
declare const BUILD_JOB: string;
|
||||
declare const BUILD_RUNNER: string;
|
||||
declare const GIT_BRANCH: string;
|
||||
declare const GIT_COMMIT: string;
|
||||
declare const NODE_VERSION: string;
|
||||
declare const WEBPACK_VERSION: string;
|
||||
|
||||
export const VERSION_INFO = {
|
||||
app: {
|
||||
name: APP_NAME,
|
||||
name: '{{ APP_NAME }}',
|
||||
},
|
||||
build: {
|
||||
job: BUILD_JOB,
|
||||
node: NODE_VERSION,
|
||||
runner: BUILD_RUNNER,
|
||||
webpack: WEBPACK_VERSION,
|
||||
job: '{{ BUILD_JOB }}',
|
||||
node: '{{ NODE_VERSION }}',
|
||||
runner: '{{ BUILD_RUNNER }}',
|
||||
},
|
||||
git: {
|
||||
branch: GIT_BRANCH,
|
||||
commit: GIT_COMMIT,
|
||||
branch: '{{ GIT_BRANCH }}',
|
||||
commit: '{{ GIT_COMMIT }}',
|
||||
},
|
||||
};
|
||||
|
|
10
yarn.lock
10
yarn.lock
|
@ -809,6 +809,14 @@ rollup-plugin-node-resolve@^5.0.2:
|
|||
resolve "^1.11.0"
|
||||
rollup-pluginutils "^2.8.0"
|
||||
|
||||
rollup-plugin-replace@^2.2.0:
|
||||
version "2.2.0"
|
||||
resolved "https://registry.yarnpkg.com/rollup-plugin-replace/-/rollup-plugin-replace-2.2.0.tgz#f41ae5372e11e7a217cde349c8b5d5fd115e70e3"
|
||||
integrity sha512-/5bxtUPkDHyBJAKketb4NfaeZjL5yLZdeUihSfbF2PQMz+rSTEb8ARKoOl3UBT4m7/X+QOXJo3sLTcq+yMMYTA==
|
||||
dependencies:
|
||||
magic-string "^0.25.2"
|
||||
rollup-pluginutils "^2.6.0"
|
||||
|
||||
rollup-plugin-typescript2@^0.21.1:
|
||||
version "0.21.1"
|
||||
resolved "https://registry.yarnpkg.com/rollup-plugin-typescript2/-/rollup-plugin-typescript2-0.21.1.tgz#91cea787c5282762f4849e334cbef6a9fdaa7564"
|
||||
|
@ -827,7 +835,7 @@ rollup-pluginutils@2.6.0:
|
|||
estree-walker "^0.6.0"
|
||||
micromatch "^3.1.10"
|
||||
|
||||
rollup-pluginutils@^2.7.0, rollup-pluginutils@^2.8.0:
|
||||
rollup-pluginutils@^2.6.0, rollup-pluginutils@^2.7.0, rollup-pluginutils@^2.8.0:
|
||||
version "2.8.1"
|
||||
resolved "https://registry.yarnpkg.com/rollup-pluginutils/-/rollup-pluginutils-2.8.1.tgz#8fa6dd0697344938ef26c2c09d2488ce9e33ce97"
|
||||
integrity sha512-J5oAoysWar6GuZo0s+3bZ6sVZAC0pfqKz68De7ZgDi5z63jOVZn1uJL/+z1jeKHNbGII8kAyHF5q8LnxSX5lQg==
|
||||
|
|
Loading…
Reference in New Issue