Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
var path = require("path")
var webpack = require("webpack")
var ExtractTextPlugin = require("extract-text-webpack-plugin")
var UglifyJsPlugin = require("uglifyjs-webpack-plugin")
var deepExtend = require("deep-extend")
var autoprefixer = require("autoprefixer")
const {gitDescribeSync} = require("git-describe")
var pkg = require("./package.json")
let gitInfo
try {
gitInfo = gitDescribeSync(__dirname)
} catch(e) {
gitInfo = {
hash: "noGit",
dirty: false
}
}
var loadersByExtension = require("./build-tools/loadersByExtension")
module.exports = function(options) {
// Special options, that have logic in this file
// ...with defaults
var specialOptions = deepExtend({}, {
hot: false,
separateStylesheets: true,
import { gitDescribeSync } from 'git-describe'
import { join, relative } from 'path'
import { writeFileSync } from 'fs-extra'
const { version, name, description, repository, homepage } = require('../package.json')
// On now we don't have access to .git :/
const git = process.env.NOW
? { raw: 'now.sh build'}
: gitDescribeSync({ dirtyMark: false, dirtySemver: false })
const result = {
name,
description,
repository,
homepage,
version,
...git,
}
const file = join(process.cwd(), 'libs', 'core', 'src', 'version.ts')
writeFileSync(file,
`// IMPORTANT: THIS FILE IS AUTO GENERATED! DO NOT MANUALLY EDIT OR CHECKIN!
/* tslint:disable */
export const VERSION = ${JSON.stringify(result, null, 4)};
const shell = require('shelljs');
const nodegit = require('nodegit');
const {
gitDescribeSync
} = require('git-describe');
const gitInfo = gitDescribeSync();
if (gitInfo.dirty) {
console.log('Please start with a clean repo');
shell.exit(1);
}
const qaVersion = gitInfo.semverString.replace('+', '.');
(async() => {
const repo = await nodegit.Repository.open('.');
const index = await repo.refreshIndex();
const defaultSig = nodegit.Signature.default(repo);
for (const file of ['package.json', 'app/package.json']) {
shell.sed('-i', '"version":[ ]*".*",$', `"version": "${qaVersion}",`, file);
await index.addByPath(file);
var path = require("path")
var webpack = require("webpack")
var ExtractTextPlugin = require("extract-text-webpack-plugin")
const CopyWebpackPlugin = require("copy-webpack-plugin")
const UglifyJsPlugin = require("uglifyjs-webpack-plugin")
var deepExtend = require("deep-extend")
const {gitDescribeSync} = require("git-describe")
const os = require("os")
var pkg = require("./package.json")
let gitInfo
try {
gitInfo = gitDescribeSync(__dirname)
} catch(e) {
gitInfo = {
hash: "noGit",
dirty: false
}
}
var commonRules = [
{ test: /\.(js(x)?)(\?.*)?$/,
use: [{
loader: "babel-loader",
options: {
retainLines: true
}
}],
include: [
function getVersion(buildType) {
const gitInfo = gitDescribeSync();
if (buildType === 'production' && gitInfo.dirty) {
throw new Error('cannot create production build with dirty git state!');
}
const version = `${gitInfo.semver}.${gitInfo.distance}`;
let versionName = 'Official Build';
if (buildType !== 'production') {
versionName = `${gitInfo.hash}${gitInfo.dirty ? '.dirty' : ''}`;
}
return {version, versionName};
}
var path = require("path")
var webpack = require("webpack")
var ExtractTextPlugin = require("extract-text-webpack-plugin")
const CopyWebpackPlugin = require("copy-webpack-plugin")
const UglifyJsPlugin = require("uglifyjs-webpack-plugin")
var deepExtend = require("deep-extend")
const {gitDescribeSync} = require("git-describe")
const os = require("os")
var pkg = require("./package.json")
let gitInfo
try {
gitInfo = gitDescribeSync(__dirname)
} catch(e) {
gitInfo = {
hash: "noGit",
dirty: false
}
}
var commonRules = [
{ test: /\.(js(x)?)(\?.*)?$/,
use: [{
loader: "babel-loader",
options: {
retainLines: true
}
}],
include: [
const {gitDescribeSync} = require('git-describe');
const {version} = require('../../package.json');
const {resolve, relative} = require('path');
const {writeFileSync} = require('fs-extra');
const gitInfo = gitDescribeSync({
dirtyMark: false,
dirtySemver: false,
longSemver: true,
});
gitInfo.packageVersion = version;
Object.assign(gitInfo.semver, {
loose: false,
options: {
includePrerelease: false,
loose: false,
}
});
const file =
resolve(__dirname, '..', '..', 'src/', 'app', 'frontend', 'environments', 'version.ts');
var path = require("path")
var webpack = require('webpack')
var ExtractTextPlugin = require('extract-text-webpack-plugin')
const CopyWebpackPlugin = require('copy-webpack-plugin')
var deepExtend = require('deep-extend')
const {gitDescribeSync} = require('git-describe')
const os = require("os")
var pkg = require("./package.json")
let gitInfo
try {
gitInfo = gitDescribeSync(__dirname)
} catch(e) {
gitInfo = {
hash: "noGit",
dirty: false
}
}
var commonRules = [
{ test: /\.(js(x)?)(\?.*)?$/,
use: [{
loader: "babel-loader",
options: {
retainLines: true
}
}],
include: [ path.join(__dirname, "src") ]