axis-checkout
Advanced tools
Comparing version 0.2.3 to 0.2.4
{ | ||
"name": "axis-checkout", | ||
"version": "0.2.3", | ||
"version": "0.2.4", | ||
"description": "", | ||
"main": "lib/checkout.js", | ||
"main": "lib/main.js", | ||
"scripts": { | ||
"start": "hjs-dev-server", | ||
"start": "NODE_ENV=development webpack-dev-server", | ||
"build": "webpack", | ||
@@ -47,2 +47,3 @@ "lint": "eslint src", | ||
"hjs-webpack": "8.4.1", | ||
"html-webpack-plugin": "^2.24.1", | ||
"jsdom": "9.8.3", | ||
@@ -56,3 +57,5 @@ "json-loader": "^0.5.4", | ||
"sass-loader": "^4.0.2", | ||
"style-loader": "^0.13.1" | ||
"style-loader": "^0.13.1", | ||
"webpack": "2.1.0-beta.27", | ||
"webpack-dev-server": "2.1.0-beta.12" | ||
}, | ||
@@ -59,0 +62,0 @@ "dependencies": { |
@@ -1,21 +0,171 @@ | ||
const getConfig = require('hjs-webpack') | ||
const path = require('path') | ||
const autoprefixer = require('autoprefixer') | ||
const DefinePlugin = require('webpack/lib/DefinePlugin') | ||
const ExtractTextPlugin = require('extract-text-webpack-plugin') | ||
const HotModuleReplacementPlugin = require('webpack/lib/HotModuleReplacementPlugin') | ||
const HtmlWebpackPlugin = require('html-webpack-plugin') | ||
const LoaderOptionsPlugin = require('webpack/lib/LoaderOptionsPlugin') | ||
const ProgressPlugin = require('webpack/lib/ProgressPlugin') | ||
const UglifyJsPlugin = require('webpack/lib/optimize/UglifyJsPlugin') | ||
// const WebpackMd5Hash = require('webpack-md5-hash') | ||
const config = getConfig({ | ||
in: 'src/index.js', | ||
out: 'lib', | ||
output: { | ||
filename: '[name].js' | ||
}, | ||
html: false, | ||
devServer: { | ||
contentBase: __dirname + '/example' | ||
}, | ||
clearBeforeBuild: true | ||
}) | ||
//========================================================= | ||
// VARS | ||
//--------------------------------------------------------- | ||
const NODE_ENV = process.env.NODE_ENV; | ||
config.entry = { | ||
'checkout': config.entry, | ||
'example-bundle': __dirname + '/example/example.js' | ||
const ENV_DEVELOPMENT = NODE_ENV === 'development' | ||
const ENV_PRODUCTION = NODE_ENV === 'production' | ||
const ENV_TEST = NODE_ENV === 'test' | ||
const HOST = '0.0.0.0' | ||
const PORT = 3000 | ||
//========================================================= | ||
// LOADERS | ||
//--------------------------------------------------------- | ||
const rules = { | ||
js: {test: /\.js$/, exclude: /node_modules/, loader: 'babel-loader'}, | ||
json: {test: /\.json$/, loader: 'json-loader'}, | ||
scss: {test: /\.(scss|css)$/, loader: 'style-loader!css-loader!postcss-loader!sass-loader'} | ||
} | ||
module.exports = config | ||
//========================================================= | ||
// CONFIG | ||
//--------------------------------------------------------- | ||
const config = module.exports = {} | ||
config.resolve = { | ||
extensions: ['.js', '.json', '.css'], | ||
modules: [ | ||
path.resolve('./src'), | ||
'node_modules' | ||
], | ||
alias: { | ||
package: path.resolve(__dirname, './package.json') | ||
} | ||
} | ||
config.module = { | ||
rules: [ | ||
rules.js, | ||
rules.json | ||
] | ||
}; | ||
config.plugins = [ | ||
new DefinePlugin({ | ||
'process.env.NODE_ENV': JSON.stringify(NODE_ENV) | ||
}), | ||
new LoaderOptionsPlugin({ | ||
debug: false, | ||
minimize: ENV_PRODUCTION, | ||
options: { | ||
postcss: [ | ||
autoprefixer({browsers: ['last 3 versions']}) | ||
], | ||
sassLoader: { | ||
outputStyle: 'compressed', | ||
precision: 10, | ||
sourceComments: false | ||
} | ||
} | ||
}) | ||
] | ||
//===================================== | ||
// DEVELOPMENT or PRODUCTION | ||
//------------------------------------- | ||
if (ENV_DEVELOPMENT || ENV_PRODUCTION) { | ||
config.entry = { | ||
main: ['./src/index'], | ||
example: './example/example' | ||
} | ||
config.output = { | ||
filename: '[name].js', | ||
path: path.resolve('./lib'), | ||
publicPath: '/' | ||
} | ||
config.plugins.push( | ||
new HtmlWebpackPlugin({ | ||
filename: 'index.html', | ||
hash: false, | ||
inject: 'body', | ||
template: './example/index.html' | ||
}) | ||
) | ||
} | ||
//===================================== | ||
// DEVELOPMENT | ||
//------------------------------------- | ||
if (ENV_DEVELOPMENT) { | ||
config.devtool = 'cheap-module-source-map' | ||
// config.entry.main.unshift( | ||
// 'babel-polyfill', | ||
// 'react-hot-loader/patch', | ||
// 'webpack/hot/only-dev-server' | ||
// ); | ||
config.module.rules.push(rules.scss) | ||
config.plugins.push( | ||
new HotModuleReplacementPlugin(), | ||
new ProgressPlugin() | ||
); | ||
config.devServer = { | ||
contentBase: './example', | ||
historyApiFallback: true, | ||
host: HOST, | ||
hot: true, | ||
port: PORT, | ||
stats: { | ||
cached: true, | ||
cachedAssets: true, | ||
chunks: true, | ||
chunkModules: false, | ||
colors: true, | ||
hash: false, | ||
reasons: true, | ||
timings: true, | ||
version: false | ||
} | ||
}; | ||
} | ||
//===================================== | ||
// PRODUCTION | ||
//------------------------------------- | ||
// if (ENV_PRODUCTION) { | ||
// config.devtool = 'hidden-source-map' | ||
// config.entry.main.unshift('babel-polyfill') | ||
// config.output.filename = '[name].[chunkhash].js' | ||
// config.module.rules.push({ | ||
// test: /\.scss$/, | ||
// loader: ExtractTextPlugin.extract('css?-autoprefixer!postcss!sass') | ||
// }) | ||
// config.plugins.push( | ||
// new WebpackMd5Hash(), | ||
// new ExtractTextPlugin('styles.[contenthash].css'), | ||
// new UglifyJsPlugin({ | ||
// comments: false, | ||
// compress: { | ||
// dead_code: true, // eslint-disable-line camelcase | ||
// screw_ie8: true, // eslint-disable-line camelcase | ||
// unused: true, | ||
// warnings: false | ||
// }, | ||
// mangle: { | ||
// screw_ie8: true // eslint-disable-line camelcase | ||
// } | ||
// }) | ||
// ) | ||
// } |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5212706
22
60074
27
2
1