Skip to content

Commit

Permalink
build(output): change output folder destination
Browse files Browse the repository at this point in the history
  • Loading branch information
tagraha committed Mar 17, 2018
1 parent 088dd0d commit 973c0e0
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,6 @@ typings/

# build folder
dist
public/
build/
server.js
server.js.map
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"start-dev": "cross-env NODE_ENV=development webpack -w & cross-env NODE_ENV=development nodemon ./server.js",
"build": "webpack",
"build:production": "cross-env NODE_ENV=production webpack -p",
"clean": "rm -rf public && rm -rf server.js",
"clean": "rm -rf build && rm -rf server.js",
"prestart": "npm run clean && npm run build:production",
"start": "node server.js",
"contributors:add": "all-contributors add",
Expand Down
2 changes: 1 addition & 1 deletion src/server/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ if(process.env.NODE_ENV === 'development') {
const app = express();

app.use(cors());
app.use(express.static("public"));
app.use(express.static("build"));

app.get("*", (req, res, next) => {
const store = configureStore();
Expand Down
12 changes: 6 additions & 6 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const browserConfig = {
entry: "./src/browser/index.js",
output: {
path: __dirname,
filename: "./public/bundle.js"
filename: "./build/bundle.js"
},
devtool: "cheap-module-source-map",
module: {
Expand All @@ -16,8 +16,8 @@ const browserConfig = {
test: [/\.svg$/, /\.gif$/, /\.jpe?g$/, /\.png$/],
loader: "file-loader",
options: {
name: "public/media/[name].[ext]",
publicPath: url => url.replace(/public/, "")
name: "build/media/[name].[ext]",
publicPath: url => url.replace(/build/, "")
}
},
{
Expand Down Expand Up @@ -45,7 +45,7 @@ const browserConfig = {
},
plugins: [
new ExtractTextPlugin({
filename: "public/css/[name].css"
filename: "build/css/[name].css"
})
]
};
Expand All @@ -65,8 +65,8 @@ const serverConfig = {
test: [/\.svg$/, /\.gif$/, /\.jpe?g$/, /\.png$/],
loader: "file-loader",
options: {
name: "public/media/[name].[ext]",
publicPath: url => url.replace(/public/, ""),
name: "build/media/[name].[ext]",
publicPath: url => url.replace(/build/, ""),
emit: false
}
},
Expand Down

0 comments on commit 973c0e0

Please sign in to comment.