skypager-documentation
Version:
documentation for working with skypager projects
56 lines (42 loc) • 1.2 kB
JavaScript
module.exports = (env, options = {}) => {
return configure({}, {
project: require('skypager/current')
})
}
const configure = (options = {}, context = {}) => {
const {project} = context
const config = project.compiler('node', {sourcemaps: false})
.buildConfig()
.context(project.cwd)
.modules(project.cwd)
.modules(project.join('src'))
.modules(project.join('..'))
.target('node')
.output({
libraryTarget: 'umd',
})
.externals(project.join('node_modules'))
.sourcemap("source-map")
.plugin('webpack.ProvidePlugin', {
fetch: 'exports?self.fetch!isomorphic-fetch',
React: 'react',
autobind: 'autobind-decorator',
})
.plugin('webpack.DllReferencePlugin', {
context: project.cwd,
manifest: project.readJsonSync(
project.resolve(project.paths.bundles, 'website.dll.json')
)
})
.plugin("webpack.BannerPlugin", {
banner: `
global.__DEV__ = true
global.chai = require('chai');
global.should = chai.should();
global.expect = chai.expect();
`,
raw: true,
})
const webpackConfig = config.getConfig()
return webpackConfig
}