mirror of
https://github.com/KevinMidboe/planetposen.git
synced 2025-10-29 09:40:31 +00:00
Created header and the start of a shopping cart.
This commit is contained in:
93
config/webpack.config.common.js
Normal file
93
config/webpack.config.common.js
Normal file
@@ -0,0 +1,93 @@
|
||||
"use strict";
|
||||
|
||||
const VueLoaderPlugin = require("vue-loader/lib/plugin");
|
||||
const MiniCSSExtractPlugin = require("mini-css-extract-plugin");
|
||||
const helpers = require("./helpers");
|
||||
const isDev = process.env.NODE_ENV === "development";
|
||||
|
||||
const webpackConfig = function(isDev) {
|
||||
return {
|
||||
entry: {
|
||||
main: ["@babel/polyfill", helpers.root("frontend", "main")]
|
||||
},
|
||||
resolve: {
|
||||
extensions: [".js", ".vue"],
|
||||
alias: {
|
||||
vue$: isDev ? "vue/dist/vue.runtime.js" : "vue/dist/vue.runtime.min.js",
|
||||
"@": helpers.root("frontend")
|
||||
}
|
||||
},
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.vue$/,
|
||||
loader: "vue-loader",
|
||||
include: [helpers.root("frontend")]
|
||||
},
|
||||
{
|
||||
test: /\.js$/,
|
||||
loader: "babel-loader",
|
||||
include: [helpers.root("frontend")]
|
||||
},
|
||||
{
|
||||
test: /\.css$/,
|
||||
use: [
|
||||
isDev ? "vue-style-loader" : MiniCSSExtractPlugin.loader,
|
||||
{ loader: "css-loader", options: { sourceMap: isDev } }
|
||||
]
|
||||
},
|
||||
{
|
||||
test: /\.scss$/,
|
||||
use: [
|
||||
isDev ? "vue-style-loader" : MiniCSSExtractPlugin.loader,
|
||||
{ loader: "css-loader", options: { sourceMap: isDev } },
|
||||
{ loader: "sass-loader", options: { sourceMap: isDev } }
|
||||
]
|
||||
},
|
||||
{
|
||||
test: /\.sass$/,
|
||||
use: [
|
||||
isDev ? "vue-style-loader" : MiniCSSExtractPlugin.loader,
|
||||
{ loader: "css-loader", options: { sourceMap: isDev } },
|
||||
{ loader: "sass-loader", options: { sourceMap: isDev } }
|
||||
]
|
||||
},
|
||||
// {
|
||||
// test: /\.s(c|a)ss$/,
|
||||
// use: [
|
||||
// 'vue-style-loader',
|
||||
// 'css-loader',
|
||||
// {
|
||||
// loader: 'sass-loader',
|
||||
// // Requires sass-loader@^7.0.0
|
||||
// options: {
|
||||
// implementation: require('sass'),
|
||||
// fiber: require('fibers'),
|
||||
// indentedSyntax: true // optional
|
||||
// },
|
||||
// // Requires sass-loader@^8.0.0
|
||||
// options: {
|
||||
// implementation: require('sass'),
|
||||
// sassOptions: {
|
||||
// fiber: require('fibers'),
|
||||
// indentedSyntax: true // optional
|
||||
// },
|
||||
// },
|
||||
// },
|
||||
// ],
|
||||
// },
|
||||
{
|
||||
test: /\.woff(2)?(\?[a-z0-9]+)?$/,
|
||||
loader: 'url-loader?limit=10000&mimetype=application/font-woff'
|
||||
},
|
||||
{
|
||||
test: /\.(ttf|eot|svg)(\?[a-z0-9]+)?$/,
|
||||
loader: 'file-loader'
|
||||
}
|
||||
]
|
||||
},
|
||||
plugins: [new VueLoaderPlugin()]
|
||||
};
|
||||
};
|
||||
|
||||
module.exports = webpackConfig;
|
||||
Reference in New Issue
Block a user