Skip to content

Commit

Permalink
更换cdn
Browse files Browse the repository at this point in the history
  • Loading branch information
yisar committed Aug 2, 2019
1 parent ce0bbfe commit 3a2dd72
Show file tree
Hide file tree
Showing 5 changed files with 61 additions and 61 deletions.
114 changes: 57 additions & 57 deletions build/wp.spa.js
Original file line number Diff line number Diff line change
@@ -1,57 +1,57 @@
const path = require('path')
const webpack = require('webpack')
const merge = require('webpack-merge')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const VueLoaderPlugin = require('vue-loader/lib/plugin')
const MiniCssExtractPlugin = require("mini-css-extract-plugin")


const baseConfig = require('./wp.base')
const isDev = process.env.NODE_ENV === 'development'

module.exports = merge(baseConfig, {
entry: {
app: './client/index.js'
},
output: {
path: path.resolve(__dirname, '../dist/spa'),
filename: 'js/[name].js',
publicPath: isDev ? 'http://localhost:2333/' : 'https://cdn.clicli.us/spa/'
},
module: {
rules: [
{
test: /\.vue$/,
loader: 'vue-loader',
options: {
preserveWhitespace: true
}
},
]
},
optimization: {
splitChunks: {
chunks: 'all'
},
runtimeChunk: true
},
plugins: [
new VueLoaderPlugin(),
new webpack.HotModuleReplacementPlugin(),
new HtmlWebpackPlugin({
template: './client/index.html'
}),
new MiniCssExtractPlugin({
filename: "../css/[name].css",
chunkFilename: "css/[id].css"
})
],
devServer: {
contentBase: path.join(__dirname, "dist/spa"),
hot: true,
compress: true,
port: 2333,
historyApiFallback: true,
}
})

const path = require('path')
const webpack = require('webpack')
const merge = require('webpack-merge')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const VueLoaderPlugin = require('vue-loader/lib/plugin')
const MiniCssExtractPlugin = require("mini-css-extract-plugin")


const baseConfig = require('./wp.base')
const isDev = process.env.NODE_ENV === 'development'

module.exports = merge(baseConfig, {
entry: {
app: './client/index.js'
},
output: {
path: path.resolve(__dirname, '../dist/spa'),
filename: 'js/[name].js',
publicPath: isDev ? 'http://localhost:2333/' : 'https://cdn.jsdelivr.net/gh/cliclitv/vue-clicli/dist/'
},
module: {
rules: [
{
test: /\.vue$/,
loader: 'vue-loader',
options: {
preserveWhitespace: true
}
},
]
},
optimization: {
splitChunks: {
chunks: 'all'
},
runtimeChunk: true
},
plugins: [
new VueLoaderPlugin(),
new webpack.HotModuleReplacementPlugin(),
new HtmlWebpackPlugin({
template: './client/index.html'
}),
new MiniCssExtractPlugin({
filename: "../css/[name].css",
chunkFilename: "css/[id].css"
})
],
devServer: {
contentBase: path.join(__dirname, "dist/spa"),
hot: true,
compress: true,
port: 2333,
historyApiFallback: true,
}
})
Loading

0 comments on commit 3a2dd72

Please sign in to comment.