This repository has been archived by the owner on Jun 14, 2018. It is now read-only.
forked from vuejs-templates/webpack
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from ryutamaki/feature/webpack2
webpack v2
- Loading branch information
Showing
26 changed files
with
255 additions
and
187 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
machine: | ||
node: | ||
version: 6 | ||
|
||
test: | ||
override: | ||
- bash test.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
var utils = require('./utils') | ||
var config = require('../config') | ||
var isProduction = process.env.NODE_ENV === 'production' | ||
|
||
module.exports = { | ||
loaders: utils.cssLoaders({ | ||
sourceMap: isProduction | ||
? config.build.productionSourceMap | ||
: config.dev.cssSourceMap, | ||
extract: isProduction | ||
}), | ||
postcss: [ | ||
require('autoprefixer')({ | ||
browsers: ['last 2 versions'] | ||
}) | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,83 +1,66 @@ | ||
var path = require('path') | ||
var config = require('../config') | ||
var utils = require('./utils') | ||
var projectRoot = path.resolve(__dirname, '../') | ||
var config = require('../config') | ||
var vueLoaderConfig = require('./vue-loader.conf') | ||
|
||
var env = process.env.NODE_ENV | ||
// check env & config/index.js to decide whether to enable CSS source maps for the | ||
// various preprocessor loaders added to vue-loader at the end of this file | ||
var cssSourceMapDev = (env === 'development' && config.dev.cssSourceMap) | ||
var cssSourceMapProd = (env === 'production' && config.build.productionSourceMap) | ||
var useCssSourceMap = cssSourceMapDev || cssSourceMapProd | ||
function resolve (dir) { | ||
return path.join(__dirname, '..', dir) | ||
} | ||
|
||
module.exports = { | ||
entry: { | ||
app: './src/main.ts' | ||
}, | ||
output: { | ||
path: config.build.assetsRoot, | ||
publicPath: process.env.NODE_ENV === 'production' ? config.build.assetsPublicPath : config.dev.assetsPublicPath, | ||
filename: '[name].js' | ||
filename: '[name].js', | ||
publicPath: process.env.NODE_ENV === 'production' | ||
? config.build.assetsPublicPath | ||
: config.dev.assetsPublicPath | ||
}, | ||
resolve: { | ||
extensions: ['', '.js', '.ts', '.vue', '.json'], | ||
fallback: [path.join(__dirname, '../node_modules')], | ||
extensions: ['.js', '.ts', '.vue', '.json'], | ||
modules: [ | ||
resolve('src'), | ||
resolve('node_modules') | ||
], | ||
alias: { | ||
{{#if_eq build "standalone"}} | ||
'vue$': 'vue/dist/vue.common.js', | ||
{{/if_eq}} | ||
'src': path.resolve(__dirname, '../src'), | ||
'assets': path.resolve(__dirname, '../src/assets'), | ||
'components': path.resolve(__dirname, '../src/components') | ||
'src': resolve('src'), | ||
'assets': resolve('src/assets'), | ||
'components': resolve('src/components') | ||
} | ||
}, | ||
resolveLoader: { | ||
fallback: [path.join(__dirname, '../node_modules')] | ||
}, | ||
module: { | ||
loaders: [ | ||
rules: [ | ||
{ | ||
test: /\.vue$/, | ||
loader: 'vue' | ||
loader: 'vue-loader', | ||
options: vueLoaderConfig | ||
}, | ||
{ | ||
test: /\.ts$/, | ||
loader: 'ts' | ||
}, | ||
{ | ||
test: /\.json$/, | ||
loader: 'json' | ||
loader: 'ts-loader', | ||
options: {appendTsSuffixTo: [/\.vue$/]} | ||
}, | ||
{ | ||
test: /\.(png|jpe?g|gif|svg)(\?.*)?$/, | ||
loader: 'url', | ||
query: { | ||
loader: 'url-loader', | ||
options: { | ||
limit: 10000, | ||
name: utils.assetsPath('img/[name].[hash:7].[ext]') | ||
} | ||
}, | ||
{ | ||
test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, | ||
loader: 'url', | ||
query: { | ||
loader: 'url-loader', | ||
options: { | ||
limit: 10000, | ||
name: utils.assetsPath('fonts/[name].[hash:7].[ext]') | ||
} | ||
} | ||
] | ||
}, | ||
vue: { | ||
loaders: Object.assign( | ||
utils.cssLoaders({ sourceMap: useCssSourceMap }), | ||
{js: 'ts'} | ||
), | ||
postcss: [ | ||
require('autoprefixer')({ | ||
browsers: ['last 2 versions'] | ||
}) | ||
] | ||
}, | ||
ts: { | ||
appendTsSuffixTo: [/\.vue$/] | ||
} | ||
} |
Oops, something went wrong.