Skip to content

Commit

Permalink
Test environment
Browse files Browse the repository at this point in the history
  • Loading branch information
icebob committed May 24, 2016
1 parent 9d620b6 commit 9dffac8
Show file tree
Hide file tree
Showing 17 changed files with 7,785 additions and 777 deletions.
36 changes: 36 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
module.exports = {
root: true,
"env": {
"browser": true,
"commonjs": true,
"es6": true,
"jquery": true
},
"extends": "eslint:recommended",
"parserOptions": {
"sourceType": "module"
},
"rules": {
"indent": [
"warn",
"tab"
],
"quotes": [
"warn",
"double"
],
"semi": [
"error",
"always"
],
"no-var": [
"error"
],
"no-console": [
"off"
],
"no-unused-vars": [
"warn"
]
}
};
47 changes: 47 additions & 0 deletions config/webpack.base.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
var path = require("path");
var webpack = require("webpack");
var sourceDir = path.resolve("lib");

var version = require("../package.json").version;
var banner = "/**\n" + " * fakerator v" + version + "\n" + " * https://github.com/icebob/fakerator\n" + " * Released under the MIT License.\n" + " */\n";

module.exports = {
entry: path.resolve('lib', 'fakerator.js'),
output: {
path: path.resolve('dist'),
filename: "fakerator.js",
library: "Fakerator",
libraryTarget: "umd"
},

plugins: [
new webpack.optimize.DedupePlugin(),
new webpack.DefinePlugin({
'process.env' : {
NODE_ENV : JSON.stringify('production')
}
}),
new webpack.BannerPlugin(banner, {
raw: true
})
],

resolve: {
alias: {
'lib': sourceDir,
'vendor': path.resolve("vendor"),
'locales': path.join(sourceDir, "locales")
}
},


module: {
loaders: [
{
"test": /\.js?$/,
"exclude": /node_modules/,
"loader": "babel"
}
]
}
};
24 changes: 24 additions & 0 deletions config/webpack.build.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
var webpack = require("webpack");
var version = require("../package.json").version;

var merge = require("webpack-merge");
var wpBaseConfig = require("./webpack.base.config");

module.exports = [
wpBaseConfig,
merge(wpBaseConfig, {
output: {
path: "./dist",
filename: "fakerator.min.js",
library: "Fakerator",
libraryTarget: "umd"
},
plugins: [
new webpack.optimize.UglifyJsPlugin({
compress: {
warnings: false
}
})
]
})
];
17 changes: 17 additions & 0 deletions config/webpack.demo.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
var webpack = require("webpack");
var version = require("../package.json").version;

var merge = require("webpack-merge");
var wpBaseConfig = require("./webpack.base.config");

module.exports = [
merge(wpBaseConfig, {
devtool: '#inline-source-map',
output: {
path: "./demo",
filename: "fakerator.js",
library: "Fakerator",
libraryTarget: "umd"
}
})
];
46 changes: 0 additions & 46 deletions config/webpack.dev.config.js

This file was deleted.

22 changes: 22 additions & 0 deletions config/webpack.test.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
var webpack = require("webpack");
var version = require("../package.json").version;

var merge = require("webpack-merge");
var wpBaseConfig = require("./webpack.base.config");

module.exports = merge(wpBaseConfig, {
entry: null,
output: null,
devtool: '#inline-source-map',
preLoaders: [
{
test: /\.js$/,
loader: 'isparta',
include: './lib',
exclude: /node_modules/
}
]
});

delete module.exports.entry;
delete module.exports.output;
Loading

0 comments on commit 9dffac8

Please sign in to comment.