Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import path from 'path'
- import webpack from 'webpack'
- import nested from 'jss-nested'
- import camelCase from 'jss-camel-case'
- import autoprefixer from 'autoprefixer'
- import HtmlWebpackPlugin from 'html-webpack-plugin'
- import CssResolvePlugin from 'elementum-tools/lib/webpack/css-resolve-plugin'
- export const entry = [
- 'babel-polyfill',
- 'webpack-hot-middleware/client',
- 'react-hot-loader/patch',
- './src/index.js',
- ]
- export const output = {
- path: '/',
- filename: '/[name].js',
- }
- export const devtool = 'eval'
- export const module = {
- rules: [
- {
- test: /\.js?$/,
- loader: 'babel-loader',
- exclude: /node_modules\/(?!ki-ui)/,
- options: {
- babelrc: false,
- presets: [
- 'es2015',
- 'stage-0',
- 'react',
- ],
- plugins: [
- ['elementum-tools/lib/babel/plugin', {
- alias: {
- KI: 'src',
- KIUI: 'node_modules/ki-ui/src',
- },
- extract: true,
- }],
- 'react-hot-loader/babel',
- 'transform-runtime',
- ],
- },
- },
- {
- test: /\.css$/,
- use: [
- 'style-loader',
- 'css-loader',
- 'postcss-loader',
- ],
- },
- {
- test: /\.jss$/,
- use: [
- 'style-loader',
- 'css-loader',
- 'postcss-loader',
- 'jss-loader',
- ],
- },
- {
- test: /\.styl$/,
- include: path.join(__dirname, '..', '..', 'src'),
- loaders: [
- 'style-loader',
- 'css-loader',
- 'stylus-loader',
- ],
- },
- {
- test: /\.(png|jpg|svg|ttf|eot|woff|woff2)$/,
- loader: 'file?name=[name].[ext]',
- },
- ],
- }
- export const plugins = [
- new CssResolvePlugin(),
- new webpack.HotModuleReplacementPlugin(),
- new HtmlWebpackPlugin({
- filename: 'index.html',
- template: path.resolve(__dirname, 'index.ejs'),
- }),
- new webpack.ProvidePlugin({
- fetch: 'imports?this=>global!exports?global.fetch!whatwg-fetch',
- }),
- new webpack.LoaderOptionsPlugin({
- options: {
- jssLoader: {
- plugins: [
- nested(),
- camelCase(),
- ],
- },
- postcss: {
- plugins: autoprefixer({
- browsers: [
- '>2%',
- 'last 2 versions',
- ],
- }),
- },
- },
- }),
- ]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement