Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cleanup for webpack, reorganize config
- Loading branch information
Showing
24 changed files
with
265 additions
and
224 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
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,26 +1,3 @@ | ||
import gulp from 'gulp'; | ||
import runSequence from 'run-sequence'; | ||
|
||
// require external tasks | ||
// import './gulp/assets.js'; | ||
// import './gulp/server.js'; | ||
import './gulp/test.js'; | ||
// import './gulp/watch.js'; | ||
// import './gulp/style.js'; | ||
// import './gulp/dist.js'; | ||
// import './gulp/e2e-test.js'; | ||
// import './gulp/browserify.js'; | ||
// import './gulp/dogen.js'; | ||
|
||
gulp.task('default', ['serve']); | ||
gulp.task('serve', (callback) => { | ||
runSequence( | ||
// 'build', | ||
'style', | ||
'assets', | ||
// 'build:vendors', | ||
// 'browserify', | ||
'watch' | ||
// 'webserver' | ||
); | ||
}); | ||
import './config/dogen.js'; |
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 was deleted.
Oops, something went wrong.
File renamed without changes.
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,91 @@ | ||
const path = require('path'); | ||
const webpack = require('webpack'); | ||
// const ngAnnotatePlugin = require('ng-annotate-webpack-plugin'); | ||
const HtmlWebpackPlugin = require('html-webpack-plugin'); | ||
const ExtractTextPlugin = require('extract-text-webpack-plugin'); | ||
const CopyWebpackPlugin = require('copy-webpack-plugin'); | ||
const getPath = (pathToFile) => path.resolve(__dirname, pathToFile); | ||
const env = process.env.NODE_ENV || 'development'; | ||
// const envConfig = require('./config/environment/' + env + '.env'); | ||
const APP_NAME = 'echoes'; | ||
|
||
module.exports = { | ||
entry: { | ||
app: [ | ||
getPath('./src/app.js'), | ||
getPath('./src/config/' + env + '.config.js') | ||
], | ||
vendors: [ | ||
'angular', | ||
'angular-ui-router', | ||
'angular-animate', | ||
'angular-sanitize', | ||
'angular-ui-bootstrap', | ||
'angular-local-storage' | ||
] | ||
}, | ||
output: { | ||
path: getPath('./dist'), | ||
filename: '[name].[hash].bundle.js' | ||
}, | ||
module: { | ||
loaders: [{ | ||
test: /\.js$/, | ||
exclude: /(node_modules)/, | ||
loaders: ['babel'] | ||
}, { | ||
test: /\.html$/, | ||
loader: 'ngtemplate!html', | ||
exclude: /(index)/ | ||
}, { | ||
test: /\.less$/, | ||
loader: ExtractTextPlugin.extract('css?sourceMap!less?sourceMap') | ||
}, | ||
// FONTS | ||
{ | ||
test: /\.woff$/, | ||
loader: 'url?limit=100000&name=./fonts/[name]/[hash].[ext]' | ||
}, { | ||
test: /\.eot$/, | ||
loader: 'file' | ||
}, { | ||
test: /\.svg$/, | ||
loader: 'url?limit=100000&name=./fonts/[name]/[hash].[ext]' | ||
}, | ||
// the url-loader uses DataUrls. | ||
// the file-loader emits files. | ||
{ | ||
test: /\.woff(2)?(\?v=[0-9]\.[0-9]\.[0-9])?$/, | ||
loader: 'url?limit=10000&minetype=application/font-woff' | ||
}, { | ||
test: /\.(ttf|eot|svg)(\?v=[0-9]\.[0-9]\.[0-9])?$/, | ||
loader: 'file' | ||
}] | ||
}, | ||
|
||
plugins: [ | ||
new webpack.DefinePlugin({ | ||
'NODE_ENV': JSON.stringify(process.env.NODE_ENV), | ||
'APP_NAME': JSON.stringify(APP_NAME) | ||
}), | ||
// new webpack.DefinePlugin({ | ||
// 'APP_ENV': JSON.stringify(envConfig) | ||
// }), | ||
new webpack.optimize.CommonsChunkPlugin('vendors', | ||
'[name].[hash].js'), | ||
new webpack.optimize.AggressiveMergingPlugin({}), | ||
new webpack.optimize.OccurenceOrderPlugin(true), | ||
new ExtractTextPlugin('[name].[hash].style.css'), | ||
// HtmlWebpackPlugin | ||
// See: https://github.com/ampedandwired/html-webpack-plugin | ||
new HtmlWebpackPlugin({ | ||
template: 'html!./src/index.html' | ||
}), | ||
new CopyWebpackPlugin([ | ||
{ | ||
from: 'src/assets', | ||
to: 'assets' | ||
} | ||
]) | ||
] | ||
}; |
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 |
---|---|---|
@@ -1,82 +1,80 @@ | ||
const path = require('path'); | ||
const webpack = require('webpack'); | ||
const ngAnnotatePlugin = require('ng-annotate-webpack-plugin'); | ||
const HtmlWebpackPlugin = require('html-webpack-plugin'); | ||
const ExtractTextPlugin = require('extract-text-webpack-plugin'); | ||
|
||
const getPath = (pathToFile) => path.resolve(__dirname, pathToFile); | ||
|
||
module.exports = { | ||
devtool: 'eval-source-map', | ||
entry: { | ||
app: [ | ||
getPath('./src/app.js'), | ||
getPath('./src/config/dev.config.js') | ||
], | ||
vendors: [ | ||
'angular', | ||
'angular-ui-router', | ||
'angular-animate', | ||
'angular-sanitize', | ||
'angular-ui-bootstrap', | ||
'angular-local-storage' | ||
] | ||
}, | ||
output: { | ||
path: getPath('./dist'), | ||
filename: '[name].[chunkhash].bundle.js', | ||
sourceMapFilename: '[name].[chunkhash].bundle.map' | ||
}, | ||
module: { | ||
loaders: [{ | ||
test: /\.js$/, | ||
exclude: /(node_modules)/, | ||
loaders: ['babel'] | ||
}, { | ||
test: /\.html$/, | ||
loader: 'ngtemplate!html', | ||
exclude: /(index)/ | ||
}, { | ||
test: /\.less$/, | ||
loader: ExtractTextPlugin.extract('css?sourceMap!less?sourceMap') | ||
}, | ||
// FONTS | ||
{ | ||
test: /\.woff$/, | ||
loader: 'url?limit=100000&name=./fonts/[name]/[hash].[ext]' | ||
}, { | ||
test: /\.eot$/, | ||
loader: 'file' | ||
}, { | ||
test: /\.svg$/, | ||
loader: 'url?limit=100000&name=./fonts/[name]/[hash].[ext]' | ||
}, | ||
// the url-loader uses DataUrls. | ||
// the file-loader emits files. | ||
{ | ||
test: /\.woff(2)?(\?v=[0-9]\.[0-9]\.[0-9])?$/, | ||
loader: 'url?limit=10000&minetype=application/font-woff' | ||
}, { | ||
test: /\.(ttf|eot|svg)(\?v=[0-9]\.[0-9]\.[0-9])?$/, | ||
loader: 'file' | ||
}] | ||
}, | ||
|
||
plugins: [ | ||
new webpack.DefinePlugin({ | ||
'NODE_ENV': JSON.stringify(process.env.NODE_ENV) | ||
}), | ||
new ngAnnotatePlugin({ | ||
add: true | ||
// other ng-annotate options here | ||
}), | ||
new webpack.optimize.CommonsChunkPlugin('vendors', | ||
'vendors.[hash].js'), | ||
new ExtractTextPlugin('[name].[chunkhash].style.css'), | ||
// HtmlWebpackPlugin | ||
// See: https://github.com/ampedandwired/html-webpack-plugin | ||
new HtmlWebpackPlugin({ | ||
template: 'html!./src/index.html' | ||
}) | ||
] | ||
var webpackCommon = require('./webpack.common'); | ||
var webpackConfig = { | ||
devtool: 'eval-source-map' | ||
}; | ||
webpackCommon.devtool = webpackConfig.devtool; | ||
module.exports = webpackCommon; | ||
// module.exports = { | ||
// devtool: 'eval-source-map', | ||
// entry: { | ||
// app: [ | ||
// getPath('./src/app.js'), | ||
// getPath('./src/config/dev.config.js') | ||
// ], | ||
// vendors: [ | ||
// 'angular', | ||
// 'angular-ui-router', | ||
// 'angular-animate', | ||
// 'angular-sanitize', | ||
// 'angular-ui-bootstrap', | ||
// 'angular-local-storage' | ||
// ] | ||
// }, | ||
// output: { | ||
// path: getPath('./dist'), | ||
// filename: '[name].[chunkhash].bundle.js', | ||
// sourceMapFilename: '[name].[chunkhash].bundle.map' | ||
// }, | ||
// module: { | ||
// loaders: [{ | ||
// test: /\.js$/, | ||
// exclude: /(node_modules)/, | ||
// loaders: ['babel'] | ||
// }, { | ||
// test: /\.html$/, | ||
// loader: 'ngtemplate!html', | ||
// exclude: /(index)/ | ||
// }, { | ||
// test: /\.less$/, | ||
// loader: ExtractTextPlugin.extract('css?sourceMap!less?sourceMap') | ||
// }, | ||
// // FONTS | ||
// { | ||
// test: /\.woff$/, | ||
// loader: 'url?limit=100000&name=./fonts/[name]/[hash].[ext]' | ||
// }, { | ||
// test: /\.eot$/, | ||
// loader: 'file' | ||
// }, { | ||
// test: /\.svg$/, | ||
// loader: 'url?limit=100000&name=./fonts/[name]/[hash].[ext]' | ||
// }, | ||
// // the url-loader uses DataUrls. | ||
// // the file-loader emits files. | ||
// { | ||
// test: /\.woff(2)?(\?v=[0-9]\.[0-9]\.[0-9])?$/, | ||
// loader: 'url?limit=10000&minetype=application/font-woff' | ||
// }, { | ||
// test: /\.(ttf|eot|svg)(\?v=[0-9]\.[0-9]\.[0-9])?$/, | ||
// loader: 'file' | ||
// }] | ||
// }, | ||
|
||
// plugins: [ | ||
// new webpack.DefinePlugin({ | ||
// 'NODE_ENV': JSON.stringify(process.env.NODE_ENV) | ||
// }), | ||
// new ngAnnotatePlugin({ | ||
// add: true | ||
// // other ng-annotate options here | ||
// }), | ||
// new webpack.optimize.CommonsChunkPlugin('vendors', | ||
// 'vendors.[hash].js'), | ||
// new ExtractTextPlugin('[name].[chunkhash].style.css'), | ||
// // HtmlWebpackPlugin | ||
// // See: https://github.com/ampedandwired/html-webpack-plugin | ||
// new HtmlWebpackPlugin({ | ||
// template: 'html!./src/index.html' | ||
// }) | ||
// ] | ||
// }; |
Oops, something went wrong.