-
-
Save anonymous/17e8670165e0d0229357270010708df9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "components", | |
"version": "1.0.0", | |
"description": "", | |
"main": "index.js", | |
"scripts": { | |
"test": "echo \"Error: no test specified\" && exit 1", | |
"build": "webpack --progress --config config/webpack.config.js" | |
}, | |
"keywords": [], | |
"author": "", | |
"license": "ISC", | |
"devDependencies": { | |
"autoprefixer": "^7.1.6", | |
"babel-core": "^6.26.0", | |
"babel-eslint": "^8.0.2", | |
"babel-loader": "^7.1.2", | |
"babel-plugin-transform-class-properties": "^6.24.1", | |
"babel-plugin-transform-object-rest-spread": "^6.26.0", | |
"babel-preset-env": "^1.6.1", | |
"babel-preset-react": "^6.24.1", | |
"css-loader": "^0.28.7", | |
"eslint": "^4.11.0", | |
"eslint-loader": "^1.9.0", | |
"eslint-plugin-babel": "^4.1.2", | |
"eslint-plugin-class-property": "^1.0.6", | |
"eslint-plugin-jsx-a11y": "^6.0.2", | |
"eslint-plugin-react": "^7.4.0", | |
"extract-text-webpack-plugin": "^3.0.2", | |
"file-loader": "^1.1.5", | |
"hint.css": "^2.5.0", | |
"postcss-flexbugs-fixes": "^3.2.0", | |
"postcss-loader": "^2.0.8", | |
"raw-loader": "^0.5.1", | |
"style-loader": "^0.19.0", | |
"stylus": "^0.54.5", | |
"stylus-loader": "^3.0.1", | |
"url-loader": "^0.6.2", | |
"webpack": "^3.8.1" | |
}, | |
"dependencies": { | |
"babel-runtime": "^6.26.0", | |
"bluebird": "^3.5.1", | |
"classnames": "^2.2.5", | |
"moment": "^2.19.2", | |
"object-assign": "^4.1.1", | |
"plural-ru": "^1.1.1", | |
"prop-types": "^15.6.0", | |
"qrcode.react": "^0.7.2", | |
"react": "^16.1.0", | |
"react-dom": "^16.1.0", | |
"tinycolor2": "^1.4.1", | |
"uuid": "^3.1.0", | |
"whatwg-fetch": "^2.0.3" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const webpack = require('webpack'); | |
const path = require('path'); | |
const ExtractTextPlugin = require('extract-text-webpack-plugin'); | |
const package = require('../package.json'); | |
const externals = Object.keys(package.dependencies).reduce((state, cur) => ({ ...state, [cur]: 'commonjs ' + cur }), {}); | |
const assetPath = 'static/media/[name].[hash:8].[ext]'; | |
module.exports = { | |
bail: true, | |
devtool: 'source-map', | |
context: path.resolve(__dirname, '..'), | |
entry: path.resolve(__dirname, '../src/library.js'), | |
externals: externals, | |
output: { | |
library: 'components', | |
libraryTarget: 'commonjs', | |
path: path.resolve(__dirname, '../build'), | |
filename: 'static/js/[name].js' | |
}, | |
resolve: { | |
extensions: ['.js', '.jsx'] | |
}, | |
module: { | |
strictExportPresence: true, | |
rules: [ | |
{ | |
test: /\.jsx?$/, | |
enforce: 'pre', | |
loader: 'eslint-loader' | |
}, | |
{ | |
test: [/\.bmp$/, /\.gif$/, /\.jpe?g$/, /\.png$/], | |
loader: 'url-loader', | |
options: { | |
limit: 10000, | |
name: assetPath, | |
}, | |
}, | |
{ | |
test: [/\.svg$/], | |
loader: 'raw-loader', | |
options: { | |
name: assetPath, | |
}, | |
}, | |
{ | |
test: /\.jsx?$/, | |
loader: 'babel-loader', | |
exclude: [/node_modules/], | |
}, | |
{ | |
test: /\.styl$/, | |
loader: ExtractTextPlugin.extract({ | |
fallback: 'style-loader', | |
use: [ | |
{ | |
loader: 'css-loader', | |
options: { | |
importLoaders: 2, | |
modules: true, | |
sourceMap: true, | |
localIdentName: '[local]--[hash:base64:5]' | |
} | |
}, | |
{ | |
loader: 'postcss-loader', | |
options: { | |
sourceMap: true | |
} | |
}, | |
{ | |
loader: 'stylus-loader' | |
} | |
] | |
}) | |
} | |
] | |
}, | |
plugins: [ | |
new ExtractTextPlugin({ filename: 'static/css/[name].css' }), | |
] | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment