Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var path = require('path')
- var webpack = require('webpack')
- var HtmlWebpackPlugin = require('html-webpack-plugin');
- module.exports = {
- entry: {
- index: ['./src/index.ts', './src/style.scss']
- },
- output: {
- path: path.resolve(__dirname, './build'),
- publicPath: '/static/',
- filename: '[name].bundle.js',
- chunkFilename: '[name].bundle.js',
- },
- plugins: [
- new webpack.optimize.CommonsChunkPlugin("common"),
- new HtmlWebpackPlugin({
- minify: false,
- filename: "index.html",
- template: "index.html",
- cache: false
- })
- ],
- module: {
- rules: [
- {
- test: /\.vue$/,
- loader: 'vue-loader',
- options: {
- loaders: {
- 'scss': 'vue-style-loader!css-loader!sass-loader',
- 'sass': 'vue-style-loader!css-loader!sass-loader?indentedSyntax',
- }
- }
- },
- {
- test: /\.tsx?$/,
- loader: 'ts-loader',
- exclude: /node_modules/
- },
- {test: /\.html$/, loader: 'html-loader?exportAsEs6Default'},
- {
- test: /\.scss$/,
- use: [{
- loader: "style-loader" // creates style nodes from JS strings
- }, {
- loader: "css-loader" // translates CSS into CommonJS
- }, {
- loader: "sass-loader" // compiles Sass to CSS
- }]
- },
- {
- test: /\.(eot|svg|ttf|woff|woff2)$/,
- use: [
- {
- loader: 'file-loader?name=./assets/fonts/webfonts/[name].[ext]'
- },
- {
- loader: 'file-loader?name=./assets/fonts/Roboto/[name].[ext]'
- }
- ]
- }
- ]
- },
- resolve: {
- extensions: ['.ts', '.js', '.vue', '.json', ".html"],
- alias: {
- 'vue$': 'vue/dist/vue.esm.js',
- "@components": path.resolve(__dirname, "src/components"),
- "@pages": path.resolve(__dirname, "src/pages"),
- "@entity": path.resolve(__dirname, "src/entity")
- }
- },
- watch: true,
- watchOptions: {
- aggregateTimeout: 300,
- ignored: /node_modules/
- },
- devServer: {
- contentBase: [path.resolve(__dirname, "build"), path.resolve(__dirname, "assets")],
- compress: true,
- port: 4200,
- historyApiFallback: true,
- noInfo:true
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement