This repository has been archived by the owner on Mar 27, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 149
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Remove multiple webpack configs * Upgrade webpack to v2, migrate config, update loaders * Update npm scripts * Add webpack support for fonts * Fix png/svg image loading
- Loading branch information
Showing
10 changed files
with
88 additions
and
106 deletions.
There are no files selected for viewing
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
module.exports = { | ||
plugins: [ | ||
require('autoprefixer') | ||
] | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
var webpack = require('webpack'); | ||
var ExtractTextPlugin = require("extract-text-webpack-plugin"); | ||
var path = require('path'); | ||
|
||
module.exports = function (env) { | ||
let buildfor = (env && env.target) ? env.target : "web"; | ||
|
||
return { | ||
target: buildfor, | ||
entry: { | ||
common: './app/App.jsx' | ||
}, | ||
resolve: { | ||
modules: [ | ||
"node_modules" | ||
], | ||
extensions: ['.js', '.jsx'] | ||
}, | ||
output: { | ||
path: path.resolve(__dirname, './dist'), | ||
publicPath: '/dist/', | ||
filename: buildfor + '-bundle.js' | ||
}, | ||
module: { | ||
rules: [ | ||
{ | ||
test: /\.jsx?$/, | ||
use: ['babel-loader?cacheDirectory=true'] | ||
}, | ||
{ | ||
test: /\.css$/, | ||
use: ExtractTextPlugin.extract({ | ||
fallback: 'style-loader', | ||
use: ['css-loader?modules=true&localIdentName=[path][name]__[local]--[hash:base64:5]', 'postcss-loader'] | ||
}), | ||
include: path.resolve(__dirname, './app') | ||
}, | ||
{ | ||
test: /\.css$/, | ||
use: ExtractTextPlugin.extract({ | ||
fallback: 'style-loader', | ||
use: ['css-loader', 'postcss-loader'] | ||
}), | ||
include: path.resolve(__dirname, './node_modules') | ||
}, | ||
{ | ||
test: /\.ico$/, | ||
use: ['file-loader?name=[name].[ext]'] | ||
}, | ||
{ | ||
test: /\.(svg|png)$/, | ||
use: ['file-loader'] | ||
}, | ||
{ | ||
test: /\.(ttf|eot|woff(2)?)(\?v=[0-9]\.[0-9]\.[0-9])?$/, | ||
use: ["file-loader"] | ||
}, | ||
] | ||
}, | ||
plugins: [ | ||
new ExtractTextPlugin("styles.css"), | ||
new webpack.IgnorePlugin(/regenerator|nodent|js-beautify/, /ajv/), | ||
new webpack.DefinePlugin({ WEBPACK_DEF_TARGET_WEB: (buildfor == "web") }) | ||
] | ||
} | ||
}; |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.