Commit c454d2e9 by James Ooi

Initial commit

parents
{
"presets": [
"env",
"stage-2"
]
}
\ No newline at end of file
# Output directories
build
# Logs
logs
*.log
npm-debug.log*
# Runtime data
pids
*.pid
*.seed
# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
# Coverage directory used by tools like istanbul
coverage
# nyc test coverage
.nyc_output
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt
# node-waf configuration
.lock-wscript
# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release
# Dependency directories
node_modules
jspm_packages
# Optional npm cache directory
.npm
# Optional REPL history
.node_repl_history
# OS generated files
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
ehthumbs.db
Thumbs.db
{
"name": "foresight",
"version": "0.1.0",
"main": "index.js",
"author": "James Ooi <wengteikooi@gmail.com>",
"license": "MIT",
"devDependencies": {
"babel-core": "^6.26.3",
"babel-loader": "^7.1.5",
"babel-preset-env": "^1.7.0",
"babel-preset-stage-2": "^6.24.1",
"webpack": "^4.16.3",
"webpack-cli": "^3.1.0"
}
}
console.log('Hello world!');
\ No newline at end of file
/**
* @fileoverview Defines the webpack configuration.
*/
const path = require('path');
const webpack = require('webpack');
const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
const isProduction = process.env.NODE_ENV === 'production' || process.argv.indexOf('-p') !== -1;
/**
* @config Webpack
*/
const config = {
mode: isProduction ? 'production' : 'development',
entry: {
'foresight': './src/foresight.js',
'foresight.min': './src/foresight.js',
},
output: {
path: path.join(__dirname, isProduction ? 'dist' : 'build'),
publicPath: '/',
library: 'Foresight',
libraryTarget: 'umd',
filename: '[name].js',
},
module: {
rules: [
{
test: /\.jsx?$/,
exclude: /node_modules/,
use: ['babel-loader'],
}
]
},
optimization: {
minimize: isProduction,
minimizer: [new UglifyJsPlugin({
include: /\.min\.js$/
})],
}
}
// Remove minified build on non-production builds
if (!isProduction) {
delete config.entry['foresight.min'];
}
module.exports = config;
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment