Skip to content

Instantly share code, notes, and snippets.

@mazz
Created October 12, 2018 03:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save mazz/26f3ebaaf1d1730596c06c2652fe75b3 to your computer and use it in GitHub Desktop.
Save mazz/26f3ebaaf1d1730596c06c2652fe75b3 to your computer and use it in GitHub Desktop.
$info: darken(#328cc1, 20%);
$primary: #083c5d;
$primary-light: #328cc1;
$navbar_color: #083c5d;
// We need to import the CSS so that webpack will load it.
// The MiniCssExtractPlugin is used to separate it out into
// its own CSS file.
import css from "../css/app.scss"
// webpack automatically bundles all modules in your
// entry points. Those entry points can be configured
// in "webpack.config.js".
//
// Import dependencies
//
import "phoenix_html"
/* This file is for your main application css. */
@import "_config";
@import "~bulma/bulma.sass";
@import "components/layout";
@import "components/navbar";
@import "components/footer";
@import "components/hero";
@import "components/section";
@import "components/offer";
@import "components/about";
@import "components/login";
{
"repository": {},
"license": "MIT",
"scripts": {
"deploy": "webpack --mode production",
"watch": "webpack --mode development --watch"
},
"dependencies": {
"bulma": "^0.7.1",
"phoenix": "file:../deps/phoenix",
"phoenix_html": "file:../deps/phoenix_html"
},
"devDependencies": {
"babel-core": "^6.26.3",
"babel-loader": "^7.1.2",
"babel-plugin-module-resolver": "^2.7.1",
"babel-plugin-transform-runtime": "^6.23.0",
"babel-preset-env": "^1.7.0",
"babel-preset-stage-0": "^6.24.1",
"babel-register": "^6.26.0",
"css-loader": "^0.28.10",
"node-sass": "^4.8.3",
"sass-loader": "^6.0.7",
"style-loader": "^0.20.3",
"copy-webpack-plugin": "^4.5.0",
"file-loader": "^2.0.0",
"mini-css-extract-plugin": "^0.4.0",
"optimize-css-assets-webpack-plugin": "^4.0.0",
"uglifyjs-webpack-plugin": "^1.2.4",
"url-loader": "^1.1.1",
"vue": "^2.5.17",
"vue-loader": "^15.4.2",
"vue-template-compiler": "^2.5.17",
"webpack": "4.4.0",
"webpack-cli": "^2.0.10"
}
}
const path = require('path');
const glob = require('glob');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
const OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin');
const CopyWebpackPlugin = require('copy-webpack-plugin');
const VueLoaderPlugin = require('vue-loader/lib/plugin');
const css_loaders = [
{
loader: 'css-loader?sourceMap'
},
{
loader: 'postcss-loader?sourceMap'
},
{
loader: 'sass-loader?sourceMap'
}
];
module.exports = (env, options) => ({
optimization: {
minimizer: [
new UglifyJsPlugin({ cache: true, parallel: true, sourceMap: false }),
new OptimizeCSSAssetsPlugin({})
]
},
entry: {
'./js/app.js': ['./js/app.js', './css/app.scss'].concat(glob.sync('./vendor/**/*.js'))
},
output: {
filename: 'app.js',
path: path.resolve(__dirname, '../priv/static/js')
},
module: {
rules: [
{
test: /\.js$/,
exclude: /node_modules/,
use: {
loader: 'babel-loader'
}
},
{
test: /\.vue$/,
loader: 'vue-loader'
},
{
test: /\.scss$/,
use: [
'style-loader', // or MiniCssExtractPlugin.loader
{ loader: 'css-loader', options: { sourceMap: true, importLoaders: 1 } },
{ loader: 'sass-loader', options: { sourceMap: true } },
],
},
{
test: /\.css$/,
use: [MiniCssExtractPlugin.loader, 'css-loader?sourceMap', 'postcss-loader?sourceMap', 'sass-loader?sourceMap']
},
{
test: /\.(jpe?g|png|gif|woff|woff2|eot|ttf|svg)(\?[a-z0-9=.]+)?$/,
loader: 'url-loader?limit=100000'
}
]
},
resolve: {
alias: {
'vue$': 'vue/dist/vue.esm.js'
},
extensions: ['*', '.js', '.vue', '.json']
},
plugins: [
new MiniCssExtractPlugin({ filename: '../css/app.scss' }),
new CopyWebpackPlugin([{ from: 'static/', to: '../' }]),
new VueLoaderPlugin(),
]
});
@mazz
Copy link
Author

mazz commented Oct 12, 2018

style_flashing

@mazz
Copy link
Author

mazz commented Oct 12, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment