Verified Commit 963b7c29 authored by Connor Shea's avatar Connor Shea 🏄

Move main.css to .scss and remove webpack-prod config.

parent 28f62851
Pipeline #26343524 passed with stage
in 1 minute and 13 seconds
......@@ -4,10 +4,12 @@ image: node:10
pages:
stage: deploy
variables:
NODE_ENV: "production"
before_script:
- yarn install
script:
- yarn run webpack-prod
- yarn run webpack
- mkdir public
- mv dist/ public/
- mv index.html public/index.html
......
......@@ -5,7 +5,7 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>MDN BCD File Creator</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" media="screen" href="main.css" />
<link rel="stylesheet" type="text/css" media="screen" href="dist/bundle.css" />
<script src="dist/bundle.js"></script>
</head>
<body>
......
{
"dependencies": {
"css-loader": "^1.0.0",
"mini-css-extract-plugin": "^0.4.1",
"sass-loader": "^7.0.3",
"vue": "^2.5.16",
"vue-loader": "^15.2.6",
"webpack": "^4.16.2",
"webpack-cli": "^3.1.0"
},
"devDependencies": {
"style-loader": "^0.21.0"
},
"scripts": {
"webpack": "webpack --config webpack.config.js",
"watch": "webpack --config webpack.config.js --watch",
"webpack-prod": "webpack --config webpack-prod.config.js"
"watch": "webpack --config webpack.config.js --watch"
}
}
const path = require('path');
module.exports = {
mode: 'production',
entry: './src/main.js',
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'bundle.js'
}
};
const path = require('path');
const devMode = process.env.NODE_ENV !== 'production';
const webpack = require('webpack');
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
module.exports = {
mode: 'development',
mode: devMode ? 'development' : 'production',
entry: './src/main.js',
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'bundle.js'
},
devServer: {
contentBase: path.join(__dirname, 'dist'),
compress: true,
port: 9000
}
module: {
rules: [
{
test: /\.(sa|sc|c)ss$/,
use: [
devMode ? 'style-loader' : MiniCssExtractPlugin.loader,
'css-loader',
'sass-loader',
]
}
]
},
plugins: [
new MiniCssExtractPlugin({
// Options similar to the same options in webpackOptions.output
// both options are optional
filename: "bundle.css"
})
]
};
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment