Skip to content

Instantly share code, notes, and snippets.

View scottaddie's full-sized avatar
💭
.NET 💜 Azure

Scott Addie scottaddie

💭
.NET 💜 Azure
View GitHub Profile
var pkgScript = require('package-script');
pkgScript.install([{
admin: false,
name: 'webpack'
}], {
callback: function () {
console.log('installed');
},
init: {
@scottaddie
scottaddie / package.json
Created September 26, 2015 03:07
package.json with package-script installed
{
"name": "ASP.NET",
"version": "0.0.0",
"scripts": {
"install_global_deps": "node installer.js"
},
"devDependencies": {
"gulp": "3.8.11",
"gulp-concat": "2.5.2",
"gulp-cssmin": "0.1.7",
@scottaddie
scottaddie / tasks.json
Last active May 19, 2017 07:56
Webpack integration via tasks.json
{
"version": "0.1.0",
"command": "${workspaceRoot}/node_modules/.bin/webpack",
"isShellCommand": true,
"args": [
"--display-modules",
"--progress"
],
"echoCommand": true,
"tasks": [
@scottaddie
scottaddie / package.json
Created October 6, 2015 02:11
Webpack scripts in package.json
"scripts": {
"dev-build": "webpack -d --display-modules --progress",
"dist-build": "webpack -p --display-modules --progress"
}
"devDependencies": {
"mocha": "^2.3.3"
},
"scripts": {
"test": "mocha --debug-brk"
}
@scottaddie
scottaddie / launch.json
Last active October 22, 2015 19:05
VS Code launch configuration for Node.js debugging
{
"version": "0.1.0",
"configurations": [
{
"name": "Debug Mocha Test",
"type": "node",
"address": "localhost",
"port": 5858,
"sourceMaps": false
}
{
"vendor": {
"js": "vendor.c7a466d957209719c8d9.js"
},
"app": {
"js": "app.eaa3ef606862a9d2be7d.js"
}
}
@scottaddie
scottaddie / webpack.config.babel.js
Created December 14, 2015 03:27
Webpack config file for the webpack-aspnet5 repo
'use strict';
const AssetsPlugin = require('assets-webpack-plugin');
const CleanPlugin = require('clean-webpack-plugin');
const path = require('path');
const pkg = require('./package');
const webpack = require('webpack');
const BUILD_DIRECTORY = 'build';
const BUILD_DROP_PATH = path.resolve(__dirname, BUILD_DIRECTORY);
@scottaddie
scottaddie / WebpackHelper.cs
Last active June 29, 2017 15:51
C# helper method to parse webpack.assets.json
public static JObject GetWebpackAssetsJson(string applicationBasePath)
{
JObject webpackAssetsJson = null;
string packageJsonFilePath = $"{applicationBasePath}\\{"package.json"}";
using (StreamReader packageJsonFile = File.OpenText(packageJsonFilePath))
{
using (JsonTextReader packageJsonReader = new JsonTextReader(packageJsonFile))
{
JObject packageJson = (JObject)JToken.ReadFrom(packageJsonReader);
@scottaddie
scottaddie / HomeController.cs
Created December 14, 2015 04:00
HomeController constructor dependency injection
private string _applicationBasePath = null;
public HomeController(IApplicationEnvironment env) {
_applicationBasePath = env.ApplicationBasePath;
}