mirror of
https://github.com/wassname/talk.git
synced 2026-06-29 01:28:36 +08:00
ef172cabfc
* host pym locally * host pym. fix some permalink styles * get url from parent document * reset copy dialog timeout * use pym.parentUrl instead of depending on the parent document * use a simpler method to find the url * add some horrible setInterval code * add some awesome polling * merge master * bail out of comment look up after 10 seconds * re-update permalink attrs * re-add my listeners to article.ejs * allow for overriding the talk db name in an environment var
108 lines
2.6 KiB
JavaScript
108 lines
2.6 KiB
JavaScript
const path = require('path');
|
|
const autoprefixer = require('autoprefixer');
|
|
const precss = require('precss');
|
|
const Copy = require('copy-webpack-plugin');
|
|
const webpack = require('webpack');
|
|
|
|
// Edit the build targets and embeds below.
|
|
|
|
const buildTargets = [
|
|
'coral-admin'
|
|
];
|
|
|
|
const buildEmbeds = [
|
|
'stream'
|
|
];
|
|
|
|
module.exports = {
|
|
devtool: 'inline-source-map',
|
|
entry: buildTargets.reduce((entry, target) => {
|
|
|
|
// Add the entry for the bundle.
|
|
entry[`${target}/bundle`] = [
|
|
'babel-polyfill',
|
|
path.join(__dirname, 'client/', target, '/src/index')
|
|
];
|
|
|
|
return entry;
|
|
}, buildEmbeds.reduce((entry, embed) => {
|
|
|
|
// Add the entry for the bundle.
|
|
entry[`embed/${embed}/bundle`] = [
|
|
'babel-polyfill',
|
|
path.join(__dirname, 'client/', `coral-embed-${embed}`, '/src/index')
|
|
];
|
|
|
|
return entry;
|
|
}, {})),
|
|
output: {
|
|
path: path.join(__dirname, 'dist'),
|
|
filename: '[name].js'
|
|
},
|
|
module: {
|
|
loaders: [
|
|
{
|
|
loader: 'babel',
|
|
exclude: /node_modules/,
|
|
test: /\.js$/
|
|
},
|
|
{
|
|
loader: 'json',
|
|
test: /\.json$/,
|
|
exclude: /node_modules/
|
|
},
|
|
{
|
|
loaders: [
|
|
'style-loader',
|
|
'css-loader?modules&importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]',
|
|
'postcss-loader'
|
|
],
|
|
test: /.css$/,
|
|
},
|
|
{
|
|
loader: 'url-loader?limit=100000',
|
|
test: /\.png$/
|
|
},
|
|
{
|
|
loader: 'file-loader',
|
|
test: /\.(jpg|png|gif|svg)$/
|
|
},
|
|
{
|
|
loader: 'url?limit=100000',
|
|
test: /\.woff$/
|
|
}
|
|
]
|
|
},
|
|
plugins: [
|
|
new Copy([
|
|
...buildEmbeds.map(embed => ({
|
|
from: path.join(__dirname, 'client', `coral-embed-${embed}`, 'style'),
|
|
to: path.join(__dirname, 'dist', 'embed', embed)
|
|
})),
|
|
{
|
|
from: path.join(__dirname, 'client', 'lib'),
|
|
to: path.join(__dirname, 'dist', 'embed', 'stream')
|
|
}
|
|
]),
|
|
autoprefixer,
|
|
precss,
|
|
new webpack.ProvidePlugin({
|
|
'fetch': 'imports?this=>global!exports?global.fetch!whatwg-fetch'
|
|
}),
|
|
new webpack.DefinePlugin({
|
|
'process.env': {
|
|
'NODE_ENV': `"${process.env.NODE_ENV}"`,
|
|
'VERSION': `"${require('./package.json').version}"`
|
|
}
|
|
})
|
|
],
|
|
resolve: {
|
|
root: [
|
|
path.join(__dirname, 'client'),
|
|
...buildTargets.map(target => path.join(__dirname, 'client', target, 'src')),
|
|
...buildEmbeds.map(embed => path.join(__dirname, 'client', `coral-embed-${embed}`, 'src'))
|
|
]
|
|
},
|
|
postcss: require('./postcss.config.js')
|
|
};
|