Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var HtmlWebpackPlugin = require( 'html-webpack-plugin' );
- var ExtractTextPlugin = require( 'extract-text-webpack-plugin' );
- var path = require( 'path' );
- module.exports = {
- devServer: {
- compress: true,
- contentBase: path.join( __dirname, '/dist' ),
- open: true,
- port: 9000,
- stats: 'errors-only'
- },
- entry: './src/app.js',
- output: {
- path: path.join( __dirname, '/dist' ),
- filename: 'app.bundle.js'
- },
- module: {
- rules: [ {
- test: /.scss$/,
- use: ExtractTextPlugin.extract( {
- fallback: 'style-loader',
- use: [
- 'css-loader',
- 'sass-loader'
- ],
- publicPath: '/dist'
- } )
- } ]
- },
- plugins: [
- new HtmlWebpackPlugin( {
- hash: true,
- minify: { collapseWhitespace: true },
- template: './src/index.html',
- title: 'Prov'
- } ),
- new ExtractTextPlugin( {
- filename: 'main.css',
- allChunks: true
- } )
- ]
- };
- var angular = require('angular');
- var proverbList = require('./proverb/list/proverb.list');
- // require other components
- // set up your app as normal
- const globby = require('globby');
- const sourceDir = 'src';
- var webpackentry = {
- app: `${__dirname}/src/app.js`
- };
- const glob = globby.sync(`${__dirname}/${sourceDir}/**/*.js`)
- .map((file)=>{
- let name = file.split('/').pop().replace('.js', '');
- webpackentry[name] = file;
- });
- const config = {
- entry: webpackentry,
- ...
- }
- let webpackentry = {
- vendor: [
- 'module1',
- 'module2',
- 'module3',
- ]
- }
- ...
- plugins: [
- new webpack.optimize.CommonsChunkPlugin({
- name: ['vendor', 'manifest'] //... add other modules
- })
- ]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement